Skip to content

SquareZoomOut Axis Rule: add support for inverted axes#3592

Merged
swharden merged 9 commits intoScottPlot:mainfrom
VisMotrix:main
Apr 5, 2024
Merged

SquareZoomOut Axis Rule: add support for inverted axes#3592
swharden merged 9 commits intoScottPlot:mainfrom
VisMotrix:main

Conversation

@VisMotrix
Copy link

…om: 1.5, top: -1.5);
This PR fixes the axis range setting if you use the SquareZoomOut and AutoScaler.InvertedX / Y

This code did not "keep" the SetLimit / AutoScaler.InvertedY setting cause SquareZoomOut rule just sets YAxis.Range.Set(yMin, yMax); we need to distinguish if the axis got inverted.

ScottPlot.Plot myPlot = new();
myPlot.Add.Signal(Generate.Sin());
myPlot.Add.Signal(Generate.Cos());
myPlot.Axes.SetLimitsY(1.5, -1.5);
myPlot.Axes.SquareUnits();

@swharden swharden changed the title Fixed SquareZoomOut rule when using inverted axis SquareZoomOut Axis Rule: add support for inverted axes Apr 5, 2024
@swharden
Copy link
Member

swharden commented Apr 5, 2024

Hi @VisMotrix, thanks for this fix! I extended this PR to make some additional improvements to the axis system. I'm merging this in now so the square zoom rules work support inverted axes, but other axis rules still don't support them so I opened #3597 to track progress toward that fix in the future.

@swharden swharden enabled auto-merge April 5, 2024 11:33
@swharden swharden merged commit 11eb45f into ScottPlot:main Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants