#3397 Resovles broken Axes labels and ticks on inverted axes#3401
Merged
swharden merged 9 commits intoScottPlot:mainfrom Mar 6, 2024
Merged
#3397 Resovles broken Axes labels and ticks on inverted axes#3401swharden merged 9 commits intoScottPlot:mainfrom
swharden merged 9 commits intoScottPlot:mainfrom
Conversation
…rvals This is necessary because inverted axes have a negatve span
…true minimum and maximum values This is necessary because inverted axes have a Min value larger than the Max value.
… values. This is necessary becase inverted axes have a Min larger than the Max.
…set on teh AutoScaler. This didn't seem to be necessary to resovle ScottPlot#3397, but seems appropriate.
…values are not Infinity. (caught by unit tests)
This was referenced Feb 24, 2024
Member
You made some great observations, and I'm really happy with the implementation you suggested in this PR - thanks so much! To be honest I didn't even realize that the cookbook example on https://scottplot.net/cookbook/5.0/AdvancedAxis/InvertedAxis/ was currently broken 🤦 Thanks for identifying the issue and fixing it!
|
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.


This pull request resolves issue #3397
The issue stems from the use of terms Min and Max, which are not numerically minimum and maximum values when axes are inverted.
The fix was to find where the assumptions were in correct and locally calculate a "trueMin" or "trueMax" value.
I believe the proper fix would be to have IAxes retain Min and Max properties, but make them a true numeric minimum and maximum. This woul dbe augmented by an "Inverted" property.
Meanwhile, IXAxis would inherit Min, Max and Inverted, and could add Left and Right properties for convenience.
Similarly, IYAxis would inherit Min, Max and Inverted properties, but could add Top and Bottom peroperties for convenience.
Unfortunately that change would require extensive changes and careful planning and woud likely introduce breaking code changes for some users.
I believe my changes are safe for existing code.
Note that this pull request is dependant on pull request #3400 (I needed the inverted axes to be functioning to test all four scenarios (X/Y axes inverted with rotation)
Test code below.