Class Plots¶
Namespace: Apogee.DevTools
Assembly: Apogee.DevTools.dll
Plots with ImPlot, for the overlay's graphs and the editor's profiler: a small surface over the binding that takes strings and spans. Use it between if (Plots.Begin("id", size)) { Plots.Axes(...); Plots.Line(...); Plots.End(); }.
public static class Plots
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods¶
Axes(string?, string?, AplotAxisFlags, AplotAxisFlags)¶
The labels (null: none) and options of the x and y axes.
public static void Axes(string? xLabel, string? yLabel, AplotAxisFlags xFlags = (AplotAxisFlags)0, AplotAxisFlags yFlags = (AplotAxisFlags)0)
Parameters¶
xLabel string?
yLabel string?
xFlags AplotAxisFlags
yFlags AplotAxisFlags
AxisFormat(AplotAxis, string)¶
A printf format for the tick labels of an axis ("%.1f ms").
public static void AxisFormat(AplotAxis axis, string format)
Parameters¶
axis AplotAxis
format string
Band(string, ReadOnlySpan<float>, ReadOnlySpan<float>, ReadOnlySpan<float>, in AplotSpec)¶
The area between two lines (ys1 and ys2 at the x values xs): a band in a stacked plot.
public static void Band(string label, ReadOnlySpan<float> xs, ReadOnlySpan<float> ys1, ReadOnlySpan<float> ys2, in AplotSpec spec)
Parameters¶
label string
xs ReadOnlySpan<float>
ys1 ReadOnlySpan<float>
ys2 ReadOnlySpan<float>
spec AplotSpec
Bars(string, ReadOnlySpan<float>, in AplotSpec, double, double)¶
public static void Bars(string label, ReadOnlySpan<float> values, in AplotSpec spec, double barSize = 0.67, double shift = 0)
Parameters¶
label string
values ReadOnlySpan<float>
spec AplotSpec
barSize double
shift double
Begin(string, Vector2, AplotFlags)¶
Begins a plot of size pixels (a zero or negative side takes what is left). Call
public static bool Begin(string id, Vector2 size, AplotFlags flags = (AplotFlags)0)
Parameters¶
id string
size Vector2
flags AplotFlags
Returns¶
Colored(Vector4, float)¶
A spec with this line color (RGBA, 0 to 1) and weight; the fill is the same color, half transparent.
public static AplotSpec Colored(Vector4 color, float lineWeight = 1.5)
Parameters¶
color Vector4
lineWeight float
Returns¶
AplotSpec
End()¶
public static void End()
Legend(AplotLocation, AplotLegendFlags)¶
public static void Legend(AplotLocation location, AplotLegendFlags flags = (AplotLegendFlags)0)
Parameters¶
location AplotLocation
flags AplotLegendFlags
Limits(double, double, double, double, bool)¶
Fixes the visible range of both axes (the player cannot pan or zoom them) or, with always false, only sets it at the start.
public static void Limits(double xMin, double xMax, double yMin, double yMax, bool always = true)
Parameters¶
xMin double
xMax double
yMin double
yMax double
always bool
Line(string, ReadOnlySpan<float>, in AplotSpec, double, double)¶
A line through values at x = xStart + i * xScale.
public static void Line(string label, ReadOnlySpan<float> values, in AplotSpec spec, double xScale = 1, double xStart = 0)
Parameters¶
label string
values ReadOnlySpan<float>
spec AplotSpec
xScale double
xStart double
Shaded(string, ReadOnlySpan<float>, in AplotSpec, double, double, double)¶
The area between the line through values and yRef.
public static void Shaded(string label, ReadOnlySpan<float> values, in AplotSpec spec, double yRef = 0, double xScale = 1, double xStart = 0)
Parameters¶
label string
values ReadOnlySpan<float>
spec AplotSpec
yRef double
xScale double
xStart double
Spec()¶
A spec with ImPlot's defaults (automatic colors); change what you want.
public static AplotSpec Spec()
Returns¶
AplotSpec