Class Plot
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Function / data plot with axes, grid and labels: linear or logarithmic X, several series, filled curves.
Typical uses: EQ and filter response, compressor transfer curve, envelope or LFO shapes. iPlug2 IVPlotControl.
public class Plot : Control
- Inheritance
-
Plot
- Inherited Members
Remarks
Call InvalidateVisual() after changing what a function depends on.
Constructors
Plot()
Creates a plot.
public Plot()
Properties
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
FillBaseline
Y value the fills go to (default: 0 clamped into the range).
public double? FillBaseline { get; set; }
Property Value
LogX
Logarithmic X axis (frequency plots; XMin must be > 0).
public bool LogX { get; set; }
Property Value
PlotArea
Plot area (inside the labels) for the current bounds.
public Rect PlotArea { get; }
Property Value
Series
Curves, drawn in order.
public List<PlotSeries> Series { get; }
Property Value
ShowAxisLabels
Draws axis labels.
public bool ShowAxisLabels { get; set; }
Property Value
ShowBackground
Draws the background panel.
public bool ShowBackground { get; set; }
Property Value
ShowGrid
Draws the grid.
public bool ShowGrid { get; set; }
Property Value
XGrid
Vertical grid lines in data units (null = automatic).
public IReadOnlyList<double>? XGrid { get; set; }
Property Value
XLabelFormatter
Formats X labels (default: compact numbers, "k" above 1000).
[Browsable(false)]
public Func<double, string>? XLabelFormatter { get; set; }
Property Value
XMax
Right of the X range.
public double XMax { get; set; }
Property Value
XMin
Left of the X range.
public double XMin { get; set; }
Property Value
YGrid
Horizontal grid lines in data units (null = automatic).
public IReadOnlyList<double>? YGrid { get; set; }
Property Value
YLabelFormatter
Formats Y labels.
[Browsable(false)]
public Func<double, string>? YLabelFormatter { get; set; }
Property Value
YMax
Top of the Y range.
public double YMax { get; set; }
Property Value
YMin
Bottom of the Y range.
public double YMin { get; set; }
Property Value
Methods
Add(Func<double, double>, Color?, bool)
Adds a function series (fluent).
public Plot Add(Func<double, double> function, Color? color = null, bool fill = false)
Parameters
Returns
DataToX(double, Rect)
Data X → screen X.
public float DataToX(double x, Rect area)
Parameters
Returns
DataToY(double, Rect)
Data Y → screen Y.
public float DataToY(double y, Rect area)
Parameters
Returns
NiceTicks(double, double, int)
"Nice" tick values (1, 2, 5 × 10ⁿ) covering a range.
public static IEnumerable<double> NiceTicks(double min, double max, int approximateCount)
Parameters
Returns
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle
XToData(float, Rect)
Screen X → data X.
public double XToData(float x, Rect area)
Parameters
Returns
YToData(float, Rect)
Screen Y → data Y.
public double YToData(float y, Rect area)