Documentation

UI::Plot

Namespace

bool UI::Plot::BeginPlot(const string&in title_id, const vec2&in size = vec2(-1, 0), int flags = UI::Plot::PlotFlags::None)

Starts a 2D plotting context. If this function returns true, EndPlot() MUST be called!

Returns bool
void UI::Plot::EndPlot()

Only call EndPlot() if BeginPlot() returns true!

bool UI::Plot::BeginSubplots(const string&in title_id, int rows, int cols, const vec2&in size, int flags = UI::Plot::SubplotFlags::None)

Starts a subdivided plotting context. If this function returns true, EndSubplots() MUST be called!

Returns bool
void UI::Plot::EndSubplots()

Only call EndSubplots() if BeginSubplots() returns true!

void UI::Plot::SetupAxis(Axis axis, const string&in label = "", int flags = UI::Plot::AxisFlags::None)

Enables an axis or sets the label and/or flags for an existing axis.

void UI::Plot::SetupAxisLimits(Axis axis, double v_min, double v_max, Cond cond = UI::Plot::Cond::Once)

Sets an axis range limits. Inversion with v_min > v_max is not supported.

void UI::Plot::SetupAxisFormat(Axis axis, const string&in fmt)

Sets the format of numeric axis labels via formater specifier (default="%g"). Formated values will be double (i.e. use %f).

void UI::Plot::SetupAxisScale(Axis axis, Scale scale)

Sets an axis' scale using built-in options.

void UI::Plot::SetupAxesLimits(double x_min, double x_max, double y_min, double y_max, Cond cond = UI::Plot::Cond::Once)

Sets the primary X and Y axes range limits. Shorthand for two calls to SetupAxisLimits.

void UI::Plot::SetupMouseText(Location location, int flags = UI::Plot::MouseTextFlags::None)

Set the location of the current plot's mouse position text (default = South|East).

void UI::Plot::PushColormap(Colormap cmap)

Temporarily switch to a different colormap. Don't forget to call PopColormap!

void UI::Plot::PopColormap(int count = 1)

Undo temporary colormap modification(s).

void UI::Plot::PlotStairs(const string&in label_id, const float[]@ values, double xscale = 1.0, double xstart = 0.0, int flags = UI::Plot::StairsFlags::None)

Plots a a stairstep graph. The y value is continued constantly to the right from every x position, i.e. the interval [x[i], x[i+1]] has the value y[i]

void UI::Plot::PlotStairs(const string&in label_id, const float[]@ xs, const float[]@ ys, int flags = UI::Plot::StairsFlags::None)

Plots a a stairstep graph. The y value is continued constantly to the right from every x position, i.e. the interval [x[i], x[i+1]] has the value y[i]

void UI::Plot::SetAxis(Axis axis)

Select which axis will be used for subsequent plot elements.

void UI::Plot::SetAxes(Axis x_axis, Axis y_axis)

Select which axes will be used for subsequent plot elements.

vec2 UI::Plot::PixelsToPlot(const vec2&in pix, Axis x_axis = UI::Plot::Axis::Auto, Axis y_axis = UI::Plot::Axis::Auto)

Convert pixels to a position in the current plot's coordinate system. Passing UI::Plot::Axis::Auto uses the current axes.

Returns vec2
vec2 UI::Plot::PixelsToPlot(float x, float y, Axis x_axis = UI::Plot::Axis::Auto, Axis y_axis = UI::Plot::Axis::Auto)

Convert pixels to a position in the current plot's coordinate system. Passing UI::Plot::Axis::Auto uses the current axes.

Returns vec2
vec2 UI::Plot::PlotToPixels(const vec2&in plt, Axis x_axis = UI::Plot::Axis::Auto, Axis y_axis = UI::Plot::Axis::Auto)

Convert a position in the current plot's coordinate system to pixels. Passing UI::Plot::Axis::Auto uses the current axes.

Returns vec2
vec2 UI::Plot::PlotToPixels(double x, double y, Axis x_axis = UI::Plot::Axis::Auto, Axis y_axis = UI::Plot::Axis::Auto)

Convert a position in the current plot's coordinate system to pixels. Passing UI::Plot::Axis::Auto uses the current axes.

Returns vec2
vec2 UI::Plot::GetPlotPos()

Get the current Plot position (top-left) in pixels.

Returns vec2
vec2 UI::Plot::GetPlotSize()

Get the curent Plot size in pixels.

Returns vec2
vec2 UI::Plot::GetPlotMousePos(Axis x_axis = UI::Plot::Axis::Auto, Axis y_axis = UI::Plot::Axis::Auto)

Returns the mouse position in x,y coordinates of the current plot. Passing UI::Plot::Axis::Auto uses the current axes.

Returns vec2
vec4 UI::Plot::GetPlotLimits(Axis x_axis = UI::Plot::Axis::Auto, Axis y_axis = UI::Plot::Axis::Auto)

Returns the current plot axis range in the form of vec4(x_min, y_min, x_max, y_max).

Returns vec4
bool UI::Plot::IsPlotHovered()

Returns true if the plot area in the current plot is hovered.

Returns bool
bool UI::Plot::IsAxisHovered(Axis axis)

Returns true if the axis label area in the current plot is hovered.

Returns bool
bool UI::Plot::IsSubplotsHovered()

Returns true if the bounding frame of a subplot is hovered.

Returns bool
bool UI::Plot::IsPlotSelected()

Returns true if the current plot is being box selected.

Returns bool
vec4 UI::Plot::GetPlotSelection(Axis x_axis = UI::Plot::Axis::Auto, Axis y_axis = UI::Plot::Axis::Auto)

Returns the current plot box selection bounds in the form of vec4(x_min, y_min, x_max, y_max). Passing UI::Plot::Axis::Auto uses the current axes.

Returns vec4
void UI::Plot::CancelPlotSelection()

Cancels the current plot box selection.

void UI::Plot::HideNextItem(bool hidden = true, Cond cond = UI::Plot::Cond::Once)

Hides or shows the next plot item (i.e. as if it were toggled from the legend).

enum UI::Plot::PlotFlags

Flags that can be passed to UI::Plot::BeginPlot.

enum UI::Plot::SubplotFlags

Flags that can be passed to UI::Plot::BeginSubplots.

enum UI::Plot::Axis

Plot axes.

enum UI::Plot::AxisFlags

Flags that can be passed to UI::Plot::SetupAxis.

enum UI::Plot::Location

Used to position items on a plot (e.g. legends, labels, etc.)

enum UI::Plot::LegendFlags

Flags that can be passed to UI::Plot::SetupLegend.

enum UI::Plot::MouseTextFlags

Flags that can be passed to UI::Plot::SetupMouseText.

enum UI::Plot::Scale

Axis scale.

enum UI::Plot::Marker

Marker specifications.

enum UI::Plot::Bin

Different automatic histogram binning methods (k = bin count or w = bin width).

enum UI::Plot::Cond

Represents a condition for SetupAxisLimits etc.

enum UI::Plot::Colormap

Built-in colormaps

enum UI::Plot::ColormapScaleFlags

Flags that can be passed to UI::Plot::ColormapScale.

enum UI::Plot::LineFlags

Flags that can be passed to UI::Plot::PlotLine.

enum UI::Plot::BarsFlags

Flags that can be passed to UI::Plot::PlotBars.

enum UI::Plot::ErrorBarsFlags

Flags that can be passed to UI::Plot::PlotErrorBars.

enum UI::Plot::ShadedFlags

Flags that can be passed to UI::Plot::PlotShaded.

enum UI::Plot::ScatterFlags

Flags that can be passed to UI::Plot::PlotScatter.

enum UI::Plot::BarGroupsFlags

Flags that can be passed to UI::Plot::PlotBarGroups.

enum UI::Plot::StemsFlags

Flags that can be passed to UI::Plot::PlotStems.

enum UI::Plot::StairsFlags

Flags that can be passed to UI::Plot::PlotStairs.

enum UI::Plot::PieChartFlags

Flags that can be passed to UI::Plot::PlotPieChart.

enum UI::Plot::HeatmapFlags

Flags that can be passed to UI::Plot::PlotHeatmap.

enum UI::Plot::HistogramFlags

Flags that can be passed to UI::Plot::PlotHistogram.