fix: resolve ASCII backend empty plots issue #225
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issue #223 where ASCII backend generated empty plots showing only frames/borders without any data visualization.
Root Cause Analysis
Multiple architectural issues were found:
ascii_draw_line()had premature return for light colors (RGB > 0.8), filtering out yellow and other bright default colorsrender_line_plot()function was just a stub - no actual line drawing implementationgather_subplot_plots()only processed multi-subplot layouts, ignoring single subplot figures (the default case)self%plotsarray but data was stored inself%subplots(1)%plotsChanges Made
ASCII Backend Fixes (
src/fortplot_ascii.f90):character instead of being skippedRendering Pipeline Fixes (
src/fortplot_rendering.f90)render_line_plot(): Complete line drawing with consecutive point connections, color setting, and scale transformationsgather_subplot_plots(): Now processes single subplot figures (default case)update_ranges_from_line_plot(): Proper data range calculation from plot datatransform_axis_ranges(): Linear coordinate transformation with padding for identical rangesself%subplots(subplot_idx)%plotsinstead ofself%plotsTest Results
Before/After
Before: Empty ASCII files with only frames and titles
After: Full data visualization showing curves, points, and proper coordinate mapping
🤖 Generated with Claude Code