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!
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!
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::SetupAxisTicks(Axis axis, const double[]@ values, const string[]@ labels = null, bool keep_default = false)
Sets an axis' ticks and optionally the labels.
void UI::Plot::SetupAxisTicks(Axis axis, double v_min, double v_max, const string[]@ labels = null, bool keep_default = false)
Sets an axis' ticks and optionally the labels for the next plot.
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::SetupAxisLimitsConstraints(Axis axis, double v_min, double v_max)
Sets an axis' limits constraints.
void UI::Plot::SetupAxisZoomConstraints(Axis axis, double z_min, double z_max)
Sets an axis' zoom constraints.
void UI::Plot::SetupAxes(const string&in x_label, const string&in y_label, int x_flags = UI::Plot::AxisFlags::None, int y_flags = UI::Plot::AxisFlags::None)
Sets the label and/or flags for primary X and Y axes (shorthand for two calls to SetupAxis).
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::SetupLegend(Location location, int flags = UI::Plot::LegendFlags::None)
Sets up the plot legend.
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::SetNextLineStyle(const vec4&in col = vec4(0, 0, 0, -1), float weight = -1.0f)
Set the line color and weight for the next item only.
void UI::Plot::SetNextFillStyle(const vec4&in col = vec4(0, 0, 0, -1), float alpha_mod = -1.0f)
Set the fill color for the next item only.
void UI::Plot::SetNextMarkerStyle(Marker marker = UI::Plot::Marker::Auto, float size = -1.0f, const vec4&in fill = vec4(0, 0, 0, -1), float weight = -1.0f, const vec4&in outline = vec4(0, 0, 0, -1))
Set the marker style for the next item only.
void UI::Plot::SetNextErrorBarStyle(const vec4&in col = vec4(0, 0, 0, -1), float size = -1.0f, float weight = -1.0f)
Set the error bar style for the next item only.
void UI::Plot::ColormapScale(const string&in label, double scale_min, double scale_max, const vec2&in size = vec2(), const string&in format = "%g", int flags = UI::Plot::ColormapScaleFlags::None, Colormap cmap = UI::Plot::Colormap::Auto)
Shows a vertical color scale with linear spaced ticks using the specified color map.
void UI::Plot::PlotLine(const string&in label_id, const float[]@ values, double x_scale = 1.0, double x_start = 0.0, int flags = UI::Plot::LineFlags::None)
Plots a standard 2D line plot.
void UI::Plot::PlotLine(const string&in label_id, const float[]@ xs, const float[]@ ys, int flags = UI::Plot::LineFlags::None)
Plots a standard 2D line plot.
void UI::Plot::PlotBars(const string&in label_id, const float[]@ values, double bar_size = 0.67, double shift = 0.0, int flags = UI::Plot::BarsFlags::None)
Plots a bar graph. Vertical by default.
void UI::Plot::PlotBars(const string&in label_id, const float[]@ xs, const float[]@ ys, double bar_size = 0.67, int flags = UI::Plot::BarsFlags::None)
Plots a bar graph. Vertical by default.
void UI::Plot::PlotErrorBars(const string&in label_id, const float[]@ xs, const float[]@ ys, const float[]@ err, int flags = UI::Plot::ErrorBarsFlags::None)
Plots vertical error bar.
void UI::Plot::PlotErrorBars(const string&in label_id, const float[]@ xs, const float[]@ ys, const float[]@ neg, const float[]@ pos, int flags = UI::Plot::ErrorBarsFlags::None)
Plots vertical error bar.
void UI::Plot::PlotShaded(const string&in label_id, const float[]@ values, double yref = 0.0, double xscale = 1.0, double xstart = 0.0, int flags = UI::Plot::ShadedFlags::None)
Plots a shaded (filled) region between two lines, or a line and a horizontal reference.
void UI::Plot::PlotShaded(const string&in label_id, const float[]@ xs, const float[]@ ys, double yref = 0.0, int flags = UI::Plot::ShadedFlags::None)
Plots a shaded (filled) region between two lines, or a line and a horizontal reference.
void UI::Plot::PlotShaded(const string&in label_id, const float[]@ xs, const float[]@ ys1, const float[]@ ys2, int flags = UI::Plot::ShadedFlags::None)
Plots a shaded (filled) region between two lines, or a line and a horizontal reference.
void UI::Plot::PlotScatter(const string&in label_id, const float[]@ values, double xscale = 1.0, double xstart = 0.0, int flags = UI::Plot::ScatterFlags::None)
Plots a standard 2D scatter plot. Default marker is UI::Plot::Marker::Circle.
void UI::Plot::PlotScatter(const string&in label_id, const float[]@ xs, const float[]@ ys, int flags = UI::Plot::ScatterFlags::None)
Plots a standard 2D scatter plot. Default marker is UI::Plot::Marker::Circle.
void UI::Plot::PlotBarGroups(const string[]@ label_ids, const float[]@ values, double group_size = 0.67, double shift = 0.0, int flags = UI::Plot::BarGroupsFlags::None)
Plots a group of bars.
void UI::Plot::PlotStems(const string&in label_id, const float[]@ values, double ref = 0.0, double scale = 1.0, double start = 0.0, int flags = UI::Plot::StemsFlags::None)
Plots stems. Vertical by default.
void UI::Plot::PlotStems(const string&in label_id, const float[]@ xs, const float[]@ ys, double ref = 0.0, int flags = UI::Plot::StemsFlags::None)
Plots stems. Vertical by default.
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::PlotPieChart(const string[]@ label_ids, const float[]@ values, double x = 0.0, double y = 0.0, double radius = 1.0, const string&in label_fmt = "%.1f", double angle0 = 90.0, int flags = UI::Plot::PieChartFlags::None)
Plots a pie chart. Center and radius are in plot units.
double UI::Plot::PlotHistogram(const string&in label_id, const float[]@ values, int bins = UI::Plot::Bin::Sturges, double bar_scale = 1.0, double min = 0.0, double max = 0.0, int flags = UI::Plot::HistogramFlags::None)
Plots a horizontal histogram. The largest bin count or density is returned.
double double UI::Plot::PlotHistogram2D(const string&in label_id, const float[]@ xs, const float[]@ ys, int x_bins = UI::Plot::Bin::Sturges, int y_bins = UI::Plot::Bin::Sturges, const vec2&in range_min = vec2(), const vec2&in range_max = vec2(), int flags = UI::Plot::HistogramFlags::None)
Plots two dimensional, bivariate histogram as a heatmap. The largest bin count or density is returned.
double 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.
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.
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.
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.
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.
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).
vec4 bool UI::Plot::IsPlotHovered()
Returns true if the plot area in the current plot is hovered.
bool bool UI::Plot::IsAxisHovered(Axis axis)
Returns true if the axis label area in the current plot is hovered.
bool bool UI::Plot::IsSubplotsHovered()
Returns true if the bounding frame of a subplot is hovered.
bool bool UI::Plot::IsPlotSelected()
Returns true if the current plot is being box selected.
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.
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.