fix: PNG backend: symlog y-axis tick labels bunched at top, missing 10^0 and linear region ticks (fixes #1717)#1816
Merged
krystophny merged 2 commits intomainfrom Apr 25, 2026
Conversation
…mpling (fixes #1717) - Set SYMMLOG_LINSCALE_ADJ to 1.0 for balanced linear/log visual space (linear region now ~27% instead of ~84% of axis height) - Subsample PDF ticks in transformed coordinate space instead of index space, preserving important powers-of-ten ticks on log/symlog scales - Updated test expectations for new transform values
Collaborator
Author
Review: APPROVEIssue-resolution gate (Issue #1717)
Code review
Deferred
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fix symlog scale tick bunching and missing ticks by:
Balanced symlog transform: Set
SYMMLOG_LINSCALE_ADJto 1.0 (was 10/9 ≈ 1.111). The old value inflated the linear region to ~84% of axis height, leaving only ~15% for the log regions. With the fix, the linear region takes ~27%, giving log regions proper visual space.Transformed-space tick subsampling: PDF backend now subsamples ticks in transformed coordinate space rather than index space. This preserves important powers-of-ten ticks (10^0, 10^2, etc.) that were previously dropped by uniform index subsampling.
Changes
src/utilities/fortplot_scales.f90: SYMMLOG_LINSCALE_ADJ = 1.0src/backends/vector/fortplot_pdf_axes.f90: subsample_ticks now accepts scale/threshold and subsamples in transformed spacetest/test_symlog_transform_values.f90: updated expected valuestest/test_raster_log_tick_positions.f90: updated spacing ratio expectationVerification
Tests pass
Artifact verification
Symlog PDF tick improvement
Before: subsampling dropped 10^2, 10^4; only 6 ticks visible
After: subsampling preserves 10^5, 10^4, 10^2, linear ticks, -10; 8 ticks with balanced spacing
Requirement-by-requirement evidence