-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Some functions should only be plotted between a range of X values.
Functions which return null throw exceptions and make rendering slow.
Public fields should be added so users can restrict function rendering to a range.
public double XMin = double.NegativeInfinity;
public double XMax = double.PositiveInfinity;Then in the render function those values should be checked and rendering should be restricted to that range.
Presently the render function calculates X/Y pairs for every point from the full visible range of the plot:
ScottPlot/src/ScottPlot4/ScottPlot/Plottable/FunctionPlot.cs
Lines 37 to 45 in 88bfe26
| public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) | |
| { | |
| List<double> xList = new List<double>(); | |
| List<double> yList = new List<double>(); | |
| PointCount = (int)dims.DataWidth; | |
| for (int columnIndex = 0; columnIndex < dims.DataWidth; columnIndex++) | |
| { | |
| double x = columnIndex * dims.UnitsPerPxX + dims.XMin; |
This feature may resolve the issue described by @phil100vol in #2138
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels