-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
Good First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!Scott won't do this soon, but PRs from the community are welcome!⚠️ HIGH PRIORITY
Description
If I pass an IFunctionSource into plot.Add.Function() which has specified RangeX to limit the function to the range, then this is ignored and the function will plot over the whole visible range.
I'm pretty sure its because the Min/Max are backwards here:
ScottPlot/src/ScottPlot5/ScottPlot5/Plottables/FunctionPlot.cs
Lines 23 to 24 in 5c02d82
| private double MinX => Math.Min(Source.RangeX.Min.FiniteCoallesce(Axes.XAxis.Min), Axes.XAxis.Min); | |
| private double MaxX => Math.Max(Source.RangeX.Max.FiniteCoallesce(Axes.XAxis.Max), Axes.XAxis.Max); |
I believe
MinX should be the Max(...) of the two mins, and MaxX should be the Min(...) of the two maxs, from what I understand.
ScottPlot.Plot myPlot = new();
myPlot.Axes.SetLimits(-10, 10, -10, 10);
myPlot.Add.Function(new FunctionSource(x => x)
{
RangeX = new CoordinateRange(-1.0, 1.0)
});
myPlot.SavePng("bug.png", 300, 300);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Good First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!Scott won't do this soon, but PRs from the community are welcome!⚠️ HIGH PRIORITY