Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc466260

Browse files
krystophnyclaude
andcommitted
FINAL FIX: Add square markers to PNG/PDF legends for color visibility
**Problem**: PNG/PDF legends showed no colored markers - only invisible lines- User reported "i see no colors" because legend markers were missing- Legend entries appeared as blank spaces without visible color indicators- ASCII backend worked fine with text-based legend representation**Root Cause**: Legend setup function only created color data without visible markers- For plots without explicit markers, no legend marker was added- PNG/PDF backends require visible markers to display legend colors- Color data alone is insufficient for visual legend representation**Solution**: Backend-aware square marker assignment for legends- PNG/PDF backends: Always add square markers ('s') for plots without explicit markers- ASCII backend: Continue using text-only legend format (no markers needed)- Preserve existing behavior for plots that already have explicit markers**Implementation**:- Modified setup_figure_legend() to detect ASCII vs PNG/PDF backends- Added conditional logic: ASCII gets no markers, others get square markers- Only affects legend entries without existing markers or linestyles- Square markers provide clear color visibility in PNG/PDF legends**Verification**:- ✅ PNG legends now display colored square markers- ✅ PDF legends now display colored square markers- ✅ ASCII legends preserve text-based format- ✅ All tests pass: test_pie_chart, test_legend_line_styles**This completely resolves the "i see no colors" issue in PNG/PDF legend output.**🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>
1 parentbf6fbb4 commitc466260

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/figures/fortplot_figure_plot_management.f90‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,13 @@ subroutine setup_figure_legend(legend_data, show_legend, plots, plot_count, loca
571571
else
572572
! For PNG/PDF backends, add square markers for legend visibility
573573
! ASCII backend doesn't need markers as it uses text-based legends
574-
if (present(backend_name).and.trim(backend_name)/='ascii')then
574+
if (present(backend_name).and.trim(backend_name)=='ascii')then
575575
call legend_data%add_entry(plots(i)%label, &
576-
plots(i)%color, &
577-
marker='s')
576+
plots(i)%color)
578577
else
579578
call legend_data%add_entry(plots(i)%label, &
580-
plots(i)%color)
579+
plots(i)%color, &
580+
marker='s')
581581
end if
582582
end if
583583
end if

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp