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 critical axis label rendering issues where tick labels, axis
labels (xlabel/ylabel), and tick marks were completely missing from
scale_examples output in both PNG and ASCII backends.
## Changes Made
### 1. Fixed Tick Label Formatting
- Replaced `G0` format (full precision) with intelligent formatting
based on value magnitude
- Values >= 1000 or < 0.01 use scientific notation (ES10.2)
- Values >= 100 use no decimal places (F0.0)
- Values >= 10 use one decimal place (F0.1)
- Values >= 1 use two decimal places (F0.2)
- Small values use three decimal places (F0.3)
### 2. Implemented Pixel-Space Rendering for PNG Backend
- Separated data coordinate rendering (for plot data) from pixel
coordinate rendering (for axes)
- Tick marks now render directly in pixel space using `draw_styled_line`
- Tick labels positioned correctly relative to tick marks in pixel
coordinates
- Axis labels (xlabel/ylabel) positioned in pixel space to avoid overlap
### 3. Proper Label Positioning
- X-axis labels positioned 30 pixels below plot area
- Y-axis labels positioned 10 pixels from left edge
- Tick labels properly spaced from tick marks (5 pixels)
- All text elements now render within image bounds
### 4. Added Comprehensive Test Coverage
- New test `test_axis_labels_rendering.f90` validates:
- Linear scale label rendering
- Log scale with power-of-ten formatting
- Symlog scale with mixed formatting
- Tick label formatting correctness
## Test Results
All tests pass successfully:
```
=== Testing Axis Labels Rendering (Issue #335) ===
PASSED: Linear scale with labels
PASSED: Log scale with labels
PASSED: Symlog scale with labels
PASSED: Tick label formatting
=== ALL AXIS LABEL TESTS PASSED ===
```
## Visual Verification
The scale_examples now correctly display:
- ✅ Title text
- ✅ X and Y axis tick marks
- ✅ Properly formatted tick labels
- ✅ X and Y axis labels (xlabel/ylabel)
- ✅ Correct log scale notation (10^2, 10^3, etc.)
- ✅ No overlapping text elements
## Issue Resolution
Fixes#335 - Axes wrong and no labels visible on scale_examples.html
The GitHub Pages visual showcase now properly displays axis labels and
tick marks for all scale types.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments