-
Notifications
You must be signed in to change notification settings - Fork 981
Description
Discussed in #1357
Originally posted by saroldhand October 13, 2021
Is there a way to set the outer view limits for a specific axis like there is for SetAxisLimits() that you can select the yAxisIndex? I have only found it to work for the primary axes and I need all created axes to be kept above 0.
I submitted this as an issue before starting this discussion that's my mistake this is my first time leaving a question.
Thank you
Indeed, SetOuterViewLimits() and SetInnerViewLimits() have no options for axis index.
ScottPlot/src/ScottPlot/Plot/Plot.Axis.cs
Lines 384 to 394 in 5d94b2f
| /// <summary> | |
| /// Set maximum outer limits beyond which the plot cannot be zoomed-out or panned. | |
| /// </summary> | |
| public void SetOuterViewLimits( | |
| double xMin = double.NegativeInfinity, double xMax = double.PositiveInfinity, | |
| double yMin = double.NegativeInfinity, double yMax = double.PositiveInfinity) | |
| { | |
| // TODO: arguments to specify axis limits | |
| settings.XAxis.Dims.SetBoundsOuter(xMin, xMax); | |
| settings.YAxis.Dims.SetBoundsOuter(yMin, yMax); | |
| } |
ScottPlot/src/ScottPlot/Plot/Plot.Axis.cs
Lines 396 to 406 in 5d94b2f
| /// <summary> | |
| /// Set minimum innter limits which will always be visible on the plot. | |
| /// </summary> | |
| public void SetInnerViewLimits( | |
| double xMin = double.NegativeInfinity, double xMax = double.PositiveInfinity, | |
| double yMin = double.NegativeInfinity, double yMax = double.PositiveInfinity) | |
| { | |
| // TODO: arguments to specify axis limits | |
| settings.XAxis.Dims.SetBoundsInner(xMin, xMax); | |
| settings.YAxis.Dims.SetBoundsInner(yMin, yMax); | |
| } |
Thanks for pointing this out @saroldhand! There is a TODO there which makes me think it was considered but not implemented, but I don't recall why. I'll investigate further to see why this is and add them if there's not a reason preventing it. Related: #1197