Skip to content

feat: add 'east' legend position support to SVG backend (fixes #1826)#1827

Merged
krystophny merged 1 commit intomainfrom
fix/issue-1826-svg-legend-east
Apr 26, 2026
Merged

feat: add 'east' legend position support to SVG backend (fixes #1826)#1827
krystophny merged 1 commit intomainfrom
fix/issue-1826-svg-legend-east

Conversation

@krystophny
Copy link
Copy Markdown
Collaborator

Summary

Add case ("east") to svg_calc_legend_pos in the SVG backend to match the LEGEND_EAST semantics already implemented in PDF, PNG, and ASCII backends.

Changes

  • src/backends/vector/fortplot_svg.f90: added case ("east") in svg_calc_legend_pos to position the legend outside the plot area to the right, centered vertically

Verification

Build

$ fpm build
[100%] Project compiled successfully.

SVG backend test

$ fpm test --target test_svg_backend
 All SVG backend tests passed

The east position places the legend at x = plot_area_left + plot_area_width + 10 (outside right edge) and y = plot_area_bottom + plot_area_height * 0.5 - 30 (centered vertically), consistent with LEGEND_EAST semantics in fortplot_legend_layout.f90 and fortplot_ascii_legend.f90.

@krystophny krystophny merged commit 419d564 into main Apr 26, 2026
5 checks passed
@krystophny krystophny deleted the fix/issue-1826-svg-legend-east branch April 26, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant