Skip to content

Axis: SetViewLimits() only supports primary axes #1361

@swharden

Description

@swharden

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.

/// <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);
}

/// <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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions