You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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:
1. **Color Filtering Bug**: ASCII backend's `ascii_draw_line()` had
premature return for light colors (RGB > 0.8), filtering out yellow and
other bright default colors
2. **Missing Plot Rendering**: `render_line_plot()` function was just a
stub - no actual line drawing implementation
3. **Subplot Data Gathering**: `gather_subplot_plots()` only processed
multi-subplot layouts, ignoring single subplot figures (the default
case)
4. **Range Calculation Stubs**: Data range calculation functions were
unimplemented stubs, leading to uninitialized coordinate ranges
5. **Data Structure Mismatch**: Rendering code expected `self%plots`
array but data was stored in `self%subplots(1)%plots`
## Changes Made
### ASCII Backend Fixes (`src/fortplot_ascii.f90`)
- Removed problematic early return for bright colors
- Implemented luminance-based character selection using standard formula
- Very bright colors now render with `:` character instead of being
skipped
- Preserves color differentiation while ensuring all data gets
visualized
### Rendering Pipeline Fixes (`src/fortplot_rendering.f90`)
- **Implemented `render_line_plot()`**: Complete line drawing with
consecutive point connections, color setting, and scale transformations
- **Fixed `gather_subplot_plots()`**: Now processes single subplot
figures (default case)
- **Implemented `update_ranges_from_line_plot()`**: Proper data range
calculation from plot data
- **Implemented `transform_axis_ranges()`**: Linear coordinate
transformation with padding for identical ranges
- **Fixed data structure access**: All rendering functions now correctly
access `self%subplots(subplot_idx)%plots` instead of `self%plots`
## Test Results
- Scale examples now show exponential curves with proper data
visualization
- ASCII plots display 150+ data characters instead of empty frames
- All test cases pass with actual plot content verification
## 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](https://claude.ai/code)
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments