You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now, plotting a function requires using a FunctionSeries, which is implemented as a LineSeries with a given rasterization step. The function values are taken from a predefined min and max X-coordinate, with a predefined step, and a line plot is created.
However, this approach has some negative consequences.
First, if you pan the plot, the visible part of the function will go out of the visible window. However, many functions (like x²) have a natural infinite domain, so it would be advantageous to show more of the function plot on panning.
Second, if you zoom in the plot, you'll see the lines which constitute the line series. However, it would be better to calculate the function values during render with a step corresponding to one pixel. This way the function would be smooth always.
Disadvantages of this approach:
You cannot derive the "natural" range from a function with an infinite domain. So either the user would need to specify a default domain for a given function, or the function would be excluded from determining the natural zoom factor.
The function will be called on each zoom/pan operation many times. This can have a negative impact on performance.
(The proposed approach is implemented in the ScottPlot library.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As of now, plotting a function requires using a
FunctionSeries
, which is implemented as aLineSeries
with a given rasterization step. The function values are taken from a predefined min and max X-coordinate, with a predefined step, and a line plot is created.However, this approach has some negative consequences.
First, if you pan the plot, the visible part of the function will go out of the visible window. However, many functions (like x²) have a natural infinite domain, so it would be advantageous to show more of the function plot on panning.
Second, if you zoom in the plot, you'll see the lines which constitute the line series. However, it would be better to calculate the function values during render with a step corresponding to one pixel. This way the function would be smooth always.
Disadvantages of this approach:
(The proposed approach is implemented in the ScottPlot library.)
Beta Was this translation helpful? Give feedback.
All reactions