#pragma once
#include "imgui.h"
#ifndef IMGUI_DISABLE
#ifndef IMPLOT_API
#define IMPLOT_API
#endif
#define IMPLOT_VERSION "1.0"
#define IMPLOT_VERSION_NUM 10000
#define IMPLOT_TMP template <typename T> IMPLOT_API
constexpr int IMPLOT_AUTO = -1;
constexpr ImVec4 IMPLOT_AUTO_COL = ImVec4(0,0,0,-1);
struct ImPlotContext;
typedef int ImAxis; typedef int ImPlotProp; typedef int ImPlotFlags; typedef int ImPlotAxisFlags; typedef int ImPlotSubplotFlags; typedef int ImPlotLegendFlags; typedef int ImPlotMouseTextFlags; typedef int ImPlotDragToolFlags; typedef int ImPlotColormapScaleFlags;
typedef int ImPlotItemFlags; typedef int ImPlotLineFlags; typedef int ImPlotScatterFlags; typedef int ImPlotBubblesFlags; typedef int ImPlotPolygonFlags; typedef int ImPlotStairsFlags; typedef int ImPlotShadedFlags; typedef int ImPlotBarsFlags; typedef int ImPlotBarGroupsFlags; typedef int ImPlotErrorBarsFlags; typedef int ImPlotStemsFlags; typedef int ImPlotInfLinesFlags; typedef int ImPlotPieChartFlags; typedef int ImPlotHeatmapFlags; typedef int ImPlotHistogramFlags; typedef int ImPlotDigitalFlags; typedef int ImPlotImageFlags; typedef int ImPlotTextFlags; typedef int ImPlotDummyFlags;
typedef int ImPlotCond; typedef int ImPlotCol; typedef int ImPlotStyleVar; typedef int ImPlotScale; typedef int ImPlotMarker; typedef int ImPlotColormap; typedef int ImPlotLocation; typedef int ImPlotBin;
enum ImAxis_ {
ImAxis_X1 = 0, ImAxis_X2, ImAxis_X3, ImAxis_Y1, ImAxis_Y2, ImAxis_Y3, ImAxis_COUNT
};
enum ImPlotProp_ {
ImPlotProp_LineColor, ImPlotProp_LineColors, ImPlotProp_LineWeight, ImPlotProp_FillColor, ImPlotProp_FillColors, ImPlotProp_FillAlpha, ImPlotProp_Marker, ImPlotProp_MarkerSize, ImPlotProp_MarkerSizes, ImPlotProp_MarkerLineColor, ImPlotProp_MarkerLineColors, ImPlotProp_MarkerFillColor, ImPlotProp_MarkerFillColors, ImPlotProp_Size, ImPlotProp_Offset, ImPlotProp_Stride, ImPlotProp_Flags };
enum ImPlotFlags_ {
ImPlotFlags_None = 0, ImPlotFlags_NoTitle = 1 << 0, ImPlotFlags_NoLegend = 1 << 1, ImPlotFlags_NoMouseText = 1 << 2, ImPlotFlags_NoInputs = 1 << 3, ImPlotFlags_NoMenus = 1 << 4, ImPlotFlags_NoBoxSelect = 1 << 5, ImPlotFlags_NoFrame = 1 << 6, ImPlotFlags_Equal = 1 << 7, ImPlotFlags_Crosshairs = 1 << 8, ImPlotFlags_CanvasOnly = ImPlotFlags_NoTitle | ImPlotFlags_NoLegend | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText
};
enum ImPlotAxisFlags_ {
ImPlotAxisFlags_None = 0, ImPlotAxisFlags_NoLabel = 1 << 0, ImPlotAxisFlags_NoGridLines = 1 << 1, ImPlotAxisFlags_NoTickMarks = 1 << 2, ImPlotAxisFlags_NoTickLabels = 1 << 3, ImPlotAxisFlags_NoInitialFit = 1 << 4, ImPlotAxisFlags_NoMenus = 1 << 5, ImPlotAxisFlags_NoSideSwitch = 1 << 6, ImPlotAxisFlags_NoHighlight = 1 << 7, ImPlotAxisFlags_Opposite = 1 << 8, ImPlotAxisFlags_Foreground = 1 << 9, ImPlotAxisFlags_Invert = 1 << 10, ImPlotAxisFlags_AutoFit = 1 << 11, ImPlotAxisFlags_RangeFit = 1 << 12, ImPlotAxisFlags_PanStretch = 1 << 13, ImPlotAxisFlags_LockMin = 1 << 14, ImPlotAxisFlags_LockMax = 1 << 15, ImPlotAxisFlags_Lock = ImPlotAxisFlags_LockMin | ImPlotAxisFlags_LockMax,
ImPlotAxisFlags_NoDecorations = ImPlotAxisFlags_NoLabel | ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_NoTickMarks | ImPlotAxisFlags_NoTickLabels,
ImPlotAxisFlags_AuxDefault = ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_Opposite
};
enum ImPlotSubplotFlags_ {
ImPlotSubplotFlags_None = 0, ImPlotSubplotFlags_NoTitle = 1 << 0, ImPlotSubplotFlags_NoLegend = 1 << 1, ImPlotSubplotFlags_NoMenus = 1 << 2, ImPlotSubplotFlags_NoResize = 1 << 3, ImPlotSubplotFlags_NoAlign = 1 << 4, ImPlotSubplotFlags_ShareItems = 1 << 5, ImPlotSubplotFlags_LinkRows = 1 << 6, ImPlotSubplotFlags_LinkCols = 1 << 7, ImPlotSubplotFlags_LinkAllX = 1 << 8, ImPlotSubplotFlags_LinkAllY = 1 << 9, ImPlotSubplotFlags_ColMajor = 1 << 10 };
enum ImPlotLegendFlags_ {
ImPlotLegendFlags_None = 0, ImPlotLegendFlags_NoButtons = 1 << 0, ImPlotLegendFlags_NoHighlightItem = 1 << 1, ImPlotLegendFlags_NoHighlightAxis = 1 << 2, ImPlotLegendFlags_NoMenus = 1 << 3, ImPlotLegendFlags_Outside = 1 << 4, ImPlotLegendFlags_Horizontal = 1 << 5, ImPlotLegendFlags_Sort = 1 << 6, ImPlotLegendFlags_Reverse = 1 << 7, };
enum ImPlotMouseTextFlags_ {
ImPlotMouseTextFlags_None = 0, ImPlotMouseTextFlags_NoAuxAxes = 1 << 0, ImPlotMouseTextFlags_NoFormat = 1 << 1, ImPlotMouseTextFlags_ShowAlways = 1 << 2, };
enum ImPlotDragToolFlags_ {
ImPlotDragToolFlags_None = 0, ImPlotDragToolFlags_NoCursors = 1 << 0, ImPlotDragToolFlags_NoFit = 1 << 1, ImPlotDragToolFlags_NoInputs = 1 << 2, ImPlotDragToolFlags_Delayed = 1 << 3, };
enum ImPlotColormapScaleFlags_ {
ImPlotColormapScaleFlags_None = 0, ImPlotColormapScaleFlags_NoLabel = 1 << 0, ImPlotColormapScaleFlags_Opposite = 1 << 1, ImPlotColormapScaleFlags_Invert = 1 << 2, };
enum ImPlotItemFlags_ {
ImPlotItemFlags_None = 0,
ImPlotItemFlags_NoLegend = 1 << 0, ImPlotItemFlags_NoFit = 1 << 1, };
enum ImPlotLineFlags_ {
ImPlotLineFlags_None = 0, ImPlotLineFlags_Segments = 1 << 10, ImPlotLineFlags_Loop = 1 << 11, ImPlotLineFlags_SkipNaN = 1 << 12, ImPlotLineFlags_NoClip = 1 << 13, ImPlotLineFlags_Shaded = 1 << 14, };
enum ImPlotScatterFlags_ {
ImPlotScatterFlags_None = 0, ImPlotScatterFlags_NoClip = 1 << 10, };
enum ImPlotBubblesFlags_ {
ImPlotBubblesFlags_None = 0, };
enum ImPlotPolygonFlags_ {
ImPlotPolygonFlags_None = 0, ImPlotPolygonFlags_Concave = 1 << 10, };
enum ImPlotStairsFlags_ {
ImPlotStairsFlags_None = 0, ImPlotStairsFlags_PreStep = 1 << 10, ImPlotStairsFlags_Shaded = 1 << 11 };
enum ImPlotShadedFlags_ {
ImPlotShadedFlags_None = 0 };
enum ImPlotBarsFlags_ {
ImPlotBarsFlags_None = 0, ImPlotBarsFlags_Horizontal = 1 << 10, };
enum ImPlotBarGroupsFlags_ {
ImPlotBarGroupsFlags_None = 0, ImPlotBarGroupsFlags_Horizontal = 1 << 10, ImPlotBarGroupsFlags_Stacked = 1 << 11, };
enum ImPlotErrorBarsFlags_ {
ImPlotErrorBarsFlags_None = 0, ImPlotErrorBarsFlags_Horizontal = 1 << 10, };
enum ImPlotStemsFlags_ {
ImPlotStemsFlags_None = 0, ImPlotStemsFlags_Horizontal = 1 << 10, };
enum ImPlotInfLinesFlags_ {
ImPlotInfLinesFlags_None = 0, ImPlotInfLinesFlags_Horizontal = 1 << 10 };
enum ImPlotPieChartFlags_ {
ImPlotPieChartFlags_None = 0, ImPlotPieChartFlags_Normalize = 1 << 10, ImPlotPieChartFlags_IgnoreHidden = 1 << 11, ImPlotPieChartFlags_Exploding = 1 << 12, ImPlotPieChartFlags_NoSliceBorder = 1 << 13 };
enum ImPlotHeatmapFlags_ {
ImPlotHeatmapFlags_None = 0, ImPlotHeatmapFlags_ColMajor = 1 << 10, };
enum ImPlotHistogramFlags_ {
ImPlotHistogramFlags_None = 0, ImPlotHistogramFlags_Horizontal = 1 << 10, ImPlotHistogramFlags_Cumulative = 1 << 11, ImPlotHistogramFlags_Density = 1 << 12, ImPlotHistogramFlags_NoOutliers = 1 << 13, ImPlotHistogramFlags_ColMajor = 1 << 14 };
enum ImPlotDigitalFlags_ {
ImPlotDigitalFlags_None = 0 };
enum ImPlotImageFlags_ {
ImPlotImageFlags_None = 0 };
enum ImPlotTextFlags_ {
ImPlotTextFlags_None = 0, ImPlotTextFlags_Vertical = 1 << 10 };
enum ImPlotDummyFlags_ {
ImPlotDummyFlags_None = 0 };
enum ImPlotCond_
{
ImPlotCond_None = ImGuiCond_None, ImPlotCond_Always = ImGuiCond_Always, ImPlotCond_Once = ImGuiCond_Once, };
enum ImPlotCol_ {
ImPlotCol_FrameBg, ImPlotCol_PlotBg, ImPlotCol_PlotBorder, ImPlotCol_LegendBg, ImPlotCol_LegendBorder, ImPlotCol_LegendText, ImPlotCol_TitleText, ImPlotCol_InlayText, ImPlotCol_AxisText, ImPlotCol_AxisGrid, ImPlotCol_AxisTick, ImPlotCol_AxisBg, ImPlotCol_AxisBgHovered, ImPlotCol_AxisBgActive, ImPlotCol_Selection, ImPlotCol_Crosshairs, ImPlotCol_COUNT
};
enum ImPlotStyleVar_ {
ImPlotStyleVar_PlotDefaultSize, ImPlotStyleVar_PlotMinSize, ImPlotStyleVar_PlotBorderSize, ImPlotStyleVar_MinorAlpha, ImPlotStyleVar_MajorTickLen, ImPlotStyleVar_MinorTickLen, ImPlotStyleVar_MajorTickSize, ImPlotStyleVar_MinorTickSize, ImPlotStyleVar_MajorGridSize, ImPlotStyleVar_MinorGridSize, ImPlotStyleVar_PlotPadding, ImPlotStyleVar_LabelPadding, ImPlotStyleVar_LegendPadding, ImPlotStyleVar_LegendInnerPadding, ImPlotStyleVar_LegendSpacing, ImPlotStyleVar_MousePosPadding, ImPlotStyleVar_AnnotationPadding, ImPlotStyleVar_FitPadding, ImPlotStyleVar_DigitalPadding, ImPlotStyleVar_DigitalSpacing, ImPlotStyleVar_COUNT
};
enum ImPlotScale_ {
ImPlotScale_Linear = 0, ImPlotScale_Time, ImPlotScale_Log10, ImPlotScale_SymLog, };
enum ImPlotMarker_ {
ImPlotMarker_None = -2, ImPlotMarker_Auto = -1, ImPlotMarker_Circle, ImPlotMarker_Square, ImPlotMarker_Diamond, ImPlotMarker_Up, ImPlotMarker_Down, ImPlotMarker_Left, ImPlotMarker_Right, ImPlotMarker_Cross, ImPlotMarker_Plus, ImPlotMarker_Asterisk, ImPlotMarker_COUNT
};
enum ImPlotColormap_ {
ImPlotColormap_Deep = 0, ImPlotColormap_Dark = 1, ImPlotColormap_Pastel = 2, ImPlotColormap_Paired = 3, ImPlotColormap_Viridis = 4, ImPlotColormap_Plasma = 5, ImPlotColormap_Hot = 6, ImPlotColormap_Cool = 7, ImPlotColormap_Pink = 8, ImPlotColormap_Jet = 9, ImPlotColormap_Twilight = 10, ImPlotColormap_RdBu = 11, ImPlotColormap_BrBG = 12, ImPlotColormap_PiYG = 13, ImPlotColormap_Spectral = 14, ImPlotColormap_Greys = 15, };
enum ImPlotLocation_ {
ImPlotLocation_Center = 0, ImPlotLocation_North = 1 << 0, ImPlotLocation_South = 1 << 1, ImPlotLocation_West = 1 << 2, ImPlotLocation_East = 1 << 3, ImPlotLocation_NorthWest = ImPlotLocation_North | ImPlotLocation_West, ImPlotLocation_NorthEast = ImPlotLocation_North | ImPlotLocation_East, ImPlotLocation_SouthWest = ImPlotLocation_South | ImPlotLocation_West, ImPlotLocation_SouthEast = ImPlotLocation_South | ImPlotLocation_East };
enum ImPlotBin_ {
ImPlotBin_Sqrt = -1, ImPlotBin_Sturges = -2, ImPlotBin_Rice = -3, ImPlotBin_Scott = -4, };
struct ImPlotSpec {
ImVec4 LineColor = IMPLOT_AUTO_COL; ImU32* LineColors = nullptr; float LineWeight = 1.0f; ImVec4 FillColor = IMPLOT_AUTO_COL; ImU32* FillColors = nullptr; float FillAlpha = 1.0f; ImPlotMarker Marker = ImPlotMarker_None; float MarkerSize = 4; float* MarkerSizes = nullptr; ImVec4 MarkerLineColor = IMPLOT_AUTO_COL; ImU32* MarkerLineColors = nullptr; ImVec4 MarkerFillColor = IMPLOT_AUTO_COL; ImU32* MarkerFillColors = nullptr; float Size = 4; int Offset = 0; int Stride = IMPLOT_AUTO; ImPlotItemFlags Flags = ImPlotItemFlags_None;
ImPlotSpec() { }
template <typename ...Args>
ImPlotSpec(Args... args) {
static_assert((sizeof ...(Args)) % 2 == 0, "Odd number of arguments! You must provide (ImPlotProp, value) pairs!");
SetProp(args...);
}
template <typename Arg, typename ...Args>
void SetProp(ImPlotProp prop, Arg arg, Args... args) {
static_assert((sizeof ...(Args)) % 2 == 0, "Odd number of arguments! You must provide (ImPlotProp,value) pairs!");
SetProp(prop, arg);
SetProp(args...);
}
template <typename T>
void SetProp(ImPlotProp prop, T v) {
switch (prop) {
case ImPlotProp_LineColor : LineColor = ImGui::ColorConvertU32ToFloat4((ImU32)v); return;
case ImPlotProp_LineWeight : LineWeight = (float)v; return;
case ImPlotProp_FillColor : FillColor = ImGui::ColorConvertU32ToFloat4((ImU32)v); return;
case ImPlotProp_FillAlpha : FillAlpha = (float)v; return;
case ImPlotProp_Marker : Marker = (ImPlotMarker)v; return;
case ImPlotProp_MarkerSize : MarkerSize = (float)v; return;
case ImPlotProp_MarkerLineColor : MarkerLineColor = ImGui::ColorConvertU32ToFloat4((ImU32)v); return;
case ImPlotProp_MarkerFillColor : MarkerFillColor = ImGui::ColorConvertU32ToFloat4((ImU32)v); return;
case ImPlotProp_Size : Size = (float)v; return;
case ImPlotProp_Offset : Offset = (int)v; return;
case ImPlotProp_Stride : Stride = (int)v; return;
case ImPlotProp_Flags : Flags = (ImPlotItemFlags)v; return;
default: break;
}
IM_ASSERT(0 && "User provided an ImPlotProp which cannot be set from scalar value!");
}
void SetProp(ImPlotProp prop, ImU32* v) {
switch (prop) {
case ImPlotProp_LineColors : LineColors = v; return;
case ImPlotProp_FillColors : FillColors = v; return;
case ImPlotProp_MarkerLineColors : MarkerLineColors = v; return;
case ImPlotProp_MarkerFillColors : MarkerFillColors = v; return;
default: break;
}
IM_ASSERT(0 && "User provided an ImPlotProp which cannot be set from pointer value!");
}
void SetProp(ImPlotProp prop, float* v) {
switch (prop) {
case ImPlotProp_MarkerSizes : MarkerSizes = v; return;
default: break;
}
IM_ASSERT(0 && "User provided an ImPlotProp which cannot be set from float pointer value!");
}
void SetProp(ImPlotProp prop, const ImVec4& v) {
switch (prop) {
case ImPlotProp_LineColor : LineColor = v; return;
case ImPlotProp_FillColor : FillColor = v; return;
case ImPlotProp_MarkerLineColor : MarkerLineColor = v; return;
case ImPlotProp_MarkerFillColor : MarkerFillColor = v; return;
default: break;
}
IM_ASSERT(0 && "User provided an ImPlotProp which cannot be set from ImVec4 value!");
}
};
IM_MSVC_RUNTIME_CHECKS_OFF
struct ImPlotPoint {
double x, y;
IMPLOT_API constexpr ImPlotPoint() : x(0.0), y(0.0) { }
IMPLOT_API constexpr ImPlotPoint(double _x, double _y) : x(_x), y(_y) { }
IMPLOT_API constexpr ImPlotPoint(const ImVec2& p) : x((double)p.x), y((double)p.y) { }
IMPLOT_API double& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return ((double*)(void*)(char*)this)[idx]; }
IMPLOT_API double operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return ((const double*)(const void*)(const char*)this)[idx]; }
#ifdef IMPLOT_POINT_CLASS_EXTRA
IMPLOT_POINT_CLASS_EXTRA #endif
};
IM_MSVC_RUNTIME_CHECKS_RESTORE
struct ImPlotRange {
double Min, Max;
IMPLOT_API constexpr ImPlotRange() : Min(0.0), Max(0.0) { }
IMPLOT_API constexpr ImPlotRange(double _min, double _max) : Min(_min), Max(_max) { }
IMPLOT_API bool Contains(double value) const { return value >= Min && value <= Max; }
IMPLOT_API double Size() const { return Max - Min; }
IMPLOT_API double Clamp(double value) const { return (value < Min) ? Min : (value > Max) ? Max : value; }
};
struct ImPlotRect {
ImPlotRange X, Y;
IMPLOT_API constexpr ImPlotRect() : X(0.0,0.0), Y(0.0,0.0) { }
IMPLOT_API constexpr ImPlotRect(double x_min, double x_max, double y_min, double y_max) : X(x_min, x_max), Y(y_min, y_max) { }
IMPLOT_API bool Contains(const ImPlotPoint& p) const { return Contains(p.x, p.y); }
IMPLOT_API bool Contains(double x, double y) const { return X.Contains(x) && Y.Contains(y); }
IMPLOT_API ImPlotPoint Size() const { return ImPlotPoint(X.Size(), Y.Size()); }
IMPLOT_API ImPlotPoint Clamp(const ImPlotPoint& p) const { return Clamp(p.x, p.y); }
IMPLOT_API ImPlotPoint Clamp(double x, double y) const { return ImPlotPoint(X.Clamp(x),Y.Clamp(y)); }
IMPLOT_API ImPlotPoint Min() const { return ImPlotPoint(X.Min, Y.Min); }
IMPLOT_API ImPlotPoint Max() const { return ImPlotPoint(X.Max, Y.Max); }
};
struct ImPlotStyle {
ImVec2 PlotDefaultSize; ImVec2 PlotMinSize; float PlotBorderSize; float MinorAlpha; ImVec2 MajorTickLen; ImVec2 MinorTickLen; ImVec2 MajorTickSize; ImVec2 MinorTickSize; ImVec2 MajorGridSize; ImVec2 MinorGridSize; ImVec2 PlotPadding; ImVec2 LabelPadding; ImVec2 LegendPadding; ImVec2 LegendInnerPadding; ImVec2 LegendSpacing; ImVec2 MousePosPadding; ImVec2 AnnotationPadding; ImVec2 FitPadding; float DigitalPadding; float DigitalSpacing; ImVec4 Colors[ImPlotCol_COUNT]; ImPlotColormap Colormap; bool UseLocalTime; bool UseISO8601; bool Use24HourClock; IMPLOT_API ImPlotStyle();
};
#if (IMGUI_VERSION_NUM < 18716)
#define ImGuiMod_None 0
#define ImGuiMod_Ctrl ImGuiKeyModFlags_Ctrl
#define ImGuiMod_Shift ImGuiKeyModFlags_Shift
#define ImGuiMod_Alt ImGuiKeyModFlags_Alt
#define ImGuiMod_Super ImGuiKeyModFlags_Super
#elif (IMGUI_VERSION_NUM < 18823)
#define ImGuiMod_None 0
#define ImGuiMod_Ctrl ImGuiModFlags_Ctrl
#define ImGuiMod_Shift ImGuiModFlags_Shift
#define ImGuiMod_Alt ImGuiModFlags_Alt
#define ImGuiMod_Super ImGuiModFlags_Super
#endif
struct ImPlotInputMap {
ImGuiMouseButton Pan; int PanMod; ImGuiMouseButton Fit; ImGuiMouseButton Select; ImGuiMouseButton SelectCancel; int SelectMod; int SelectHorzMod; int SelectVertMod; ImGuiMouseButton Menu; int OverrideMod; int ZoomMod; float ZoomRate; IMPLOT_API ImPlotInputMap();
};
typedef int (*ImPlotFormatter)(double value, char* buff, int size, void* user_data);
typedef ImPlotPoint (*ImPlotGetter)(int idx, void* user_data);
typedef double (*ImPlotTransform)(double value, void* user_data);
namespace ImPlot {
IMPLOT_API ImPlotContext* CreateContext();
IMPLOT_API void DestroyContext(ImPlotContext* ctx = nullptr);
IMPLOT_API ImPlotContext* GetCurrentContext();
IMPLOT_API void SetCurrentContext(ImPlotContext* ctx);
IMPLOT_API void SetImGuiContext(ImGuiContext* ctx);
IMPLOT_API bool BeginPlot(const char* title_id, const ImVec2& size=ImVec2(-1,0), ImPlotFlags flags=0);
IMPLOT_API void EndPlot();
IMPLOT_API bool BeginSubplots(const char* title_id,
int rows,
int cols,
const ImVec2& size,
ImPlotSubplotFlags flags = 0,
float* row_ratios = nullptr,
float* col_ratios = nullptr);
IMPLOT_API void EndSubplots();
IMPLOT_API void SetupAxis(ImAxis axis, const char* label=nullptr, ImPlotAxisFlags flags=0);
IMPLOT_API void SetupAxisLimits(ImAxis axis, double v_min, double v_max, ImPlotCond cond = ImPlotCond_Once);
IMPLOT_API void SetupAxisLinks(ImAxis axis, double* link_min, double* link_max);
IMPLOT_API void SetupAxisFormat(ImAxis axis, const char* fmt);
IMPLOT_API void SetupAxisFormat(ImAxis axis, ImPlotFormatter formatter, void* data=nullptr);
IMPLOT_API void SetupAxisTicks(ImAxis axis, const double* values, int n_ticks, const char* const labels[]=nullptr, bool keep_default=false);
IMPLOT_API void SetupAxisTicks(ImAxis axis, double v_min, double v_max, int n_ticks, const char* const labels[]=nullptr, bool keep_default=false);
IMPLOT_API void SetupAxisScale(ImAxis axis, ImPlotScale scale);
IMPLOT_API void SetupAxisScale(ImAxis axis, ImPlotTransform forward, ImPlotTransform inverse, void* data=nullptr);
IMPLOT_API void SetupAxisLimitsConstraints(ImAxis axis, double v_min, double v_max);
IMPLOT_API void SetupAxisZoomConstraints(ImAxis axis, double z_min, double z_max);
IMPLOT_API void SetupAxes(const char* x_label, const char* y_label, ImPlotAxisFlags x_flags=0, ImPlotAxisFlags y_flags=0);
IMPLOT_API void SetupAxesLimits(double x_min, double x_max, double y_min, double y_max, ImPlotCond cond = ImPlotCond_Once);
IMPLOT_API void SetupLegend(ImPlotLocation location, ImPlotLegendFlags flags=0);
IMPLOT_API void SetupMouseText(ImPlotLocation location, ImPlotMouseTextFlags flags=0);
IMPLOT_API void SetupFinish();
IMPLOT_API void SetNextAxisLimits(ImAxis axis, double v_min, double v_max, ImPlotCond cond = ImPlotCond_Once);
IMPLOT_API void SetNextAxisLinks(ImAxis axis, double* link_min, double* link_max);
IMPLOT_API void SetNextAxisToFit(ImAxis axis);
IMPLOT_API void SetNextAxesLimits(double x_min, double x_max, double y_min, double y_max, ImPlotCond cond = ImPlotCond_Once);
IMPLOT_API void SetNextAxesToFit();
IMPLOT_TMP void PlotLine(const char* label_id, const T* values, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotLine(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_API void PlotLineG(const char* label_id, ImPlotGetter getter, void* data, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotScatter(const char* label_id, const T* values, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotScatter(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_API void PlotScatterG(const char* label_id, ImPlotGetter getter, void* data, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotBubbles(const char* label_id, const T* values, const T* szs, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotBubbles(const char* label_id, const T* xs, const T* ys, const T* szs, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotPolygon(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotStairs(const char* label_id, const T* values, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotStairs(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_API void PlotStairsG(const char* label_id, ImPlotGetter getter, void* data, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotShaded(const char* label_id, const T* values, int count, double yref=0, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotShaded(const char* label_id, const T* xs, const T* ys, int count, double yref=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotShaded(const char* label_id, const T* xs, const T* ys1, const T* ys2, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_API void PlotShadedG(const char* label_id, ImPlotGetter getter1, void* data1, ImPlotGetter getter2, void* data2, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotBars(const char* label_id, const T* values, int count, double bar_size=0.67, double shift=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotBars(const char* label_id, const T* xs, const T* ys, int count, double bar_size, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_API void PlotBarsG(const char* label_id, ImPlotGetter getter, void* data, int count, double bar_size, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotBarGroups(const char* const label_ids[], const T* values, int item_count, int group_count, double group_size=0.67, double shift=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* err, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* neg, const T* pos, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotStems(const char* label_id, const T* values, int count, double ref=0, double scale=1, double start=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotStems(const char* label_id, const T* xs, const T* ys, int count, double ref=0, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotInfLines(const char* label_id, const T* values, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotPieChart(const char* const label_ids[], const T* values, int count, double x, double y, double radius, ImPlotFormatter fmt, void* fmt_data=nullptr, double angle0=90, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotPieChart(const char* const label_ids[], const T* values, int count, double x, double y, double radius, const char* label_fmt="%.1f", double angle0=90, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotHeatmap(const char* label_id, const T* values, int rows, int cols, double scale_min=0, double scale_max=0, const char* label_fmt="%.1f", const ImPlotPoint& bounds_min=ImPlotPoint(0,0), const ImPlotPoint& bounds_max=ImPlotPoint(1,1), const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP double PlotHistogram(const char* label_id, const T* values, int count, int bins=ImPlotBin_Sturges, double bar_scale=1.0, ImPlotRange range=ImPlotRange(), const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP double PlotHistogram2D(const char* label_id, const T* xs, const T* ys, int count, int x_bins=ImPlotBin_Sturges, int y_bins=ImPlotBin_Sturges, ImPlotRect range=ImPlotRect(), const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_TMP void PlotDigital(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_API void PlotDigitalG(const char* label_id, ImPlotGetter getter, void* data, int count, const ImPlotSpec& spec=ImPlotSpec());
#ifdef IMGUI_HAS_TEXTURES
IMPLOT_API void PlotImage(const char* label_id, ImTextureRef tex_ref, const ImPlotPoint& bounds_min, const ImPlotPoint& bounds_max, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImPlotSpec& spec=ImPlotSpec());
#else
IMPLOT_API void PlotImage(const char* label_id, ImTextureID tex_ref, const ImPlotPoint& bounds_min, const ImPlotPoint& bounds_max, const ImVec2& uv0=ImVec2(0,0), const ImVec2& uv1=ImVec2(1,1), const ImVec4& tint_col=ImVec4(1,1,1,1), const ImPlotSpec& spec=ImPlotSpec());
#endif
IMPLOT_API void PlotText(const char* text, double x, double y, const ImVec2& pix_offset=ImVec2(0,0), const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_API void PlotDummy(const char* label_id, const ImPlotSpec& spec=ImPlotSpec());
IMPLOT_API bool DragPoint(int id, double* x, double* y, const ImVec4& col, float size = 4, ImPlotDragToolFlags flags = 0, bool* out_clicked = nullptr, bool* out_hovered = nullptr, bool* out_held = nullptr);
IMPLOT_API bool DragLineX(int id, double* x, const ImVec4& col, float thickness = 1, ImPlotDragToolFlags flags = 0, bool* out_clicked = nullptr, bool* out_hovered = nullptr, bool* out_held = nullptr);
IMPLOT_API bool DragLineY(int id, double* y, const ImVec4& col, float thickness = 1, ImPlotDragToolFlags flags = 0, bool* out_clicked = nullptr, bool* out_hovered = nullptr, bool* out_held = nullptr);
IMPLOT_API bool DragRect(int id, double* x1, double* y1, double* x2, double* y2, const ImVec4& col, ImPlotDragToolFlags flags = 0, bool* out_clicked = nullptr, bool* out_hovered = nullptr, bool* out_held = nullptr);
IMPLOT_API void Annotation(double x, double y, const ImVec4& col, const ImVec2& pix_offset, bool clamp, bool round = false);
IMPLOT_API void Annotation(double x, double y, const ImVec4& col, const ImVec2& pix_offset, bool clamp, const char* fmt, ...) IM_FMTARGS(6);
IMPLOT_API void AnnotationV(double x, double y, const ImVec4& col, const ImVec2& pix_offset, bool clamp, const char* fmt, va_list args) IM_FMTLIST(6);
IMPLOT_API void TagX(double x, const ImVec4& col, bool round = false);
IMPLOT_API void TagX(double x, const ImVec4& col, const char* fmt, ...) IM_FMTARGS(3);
IMPLOT_API void TagXV(double x, const ImVec4& col, const char* fmt, va_list args) IM_FMTLIST(3);
IMPLOT_API void TagY(double y, const ImVec4& col, bool round = false);
IMPLOT_API void TagY(double y, const ImVec4& col, const char* fmt, ...) IM_FMTARGS(3);
IMPLOT_API void TagYV(double y, const ImVec4& col, const char* fmt, va_list args) IM_FMTLIST(3);
IMPLOT_API void SetAxis(ImAxis axis);
IMPLOT_API void SetAxes(ImAxis x_axis, ImAxis y_axis);
IMPLOT_API ImPlotPoint PixelsToPlot(const ImVec2& pix, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
IMPLOT_API ImPlotPoint PixelsToPlot(float x, float y, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
IMPLOT_API ImVec2 PlotToPixels(const ImPlotPoint& plt, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
IMPLOT_API ImVec2 PlotToPixels(double x, double y, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
IMPLOT_API ImVec2 GetPlotPos();
IMPLOT_API ImVec2 GetPlotSize();
IMPLOT_API ImPlotPoint GetPlotMousePos(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
IMPLOT_API ImPlotRect GetPlotLimits(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
IMPLOT_API bool IsPlotHovered();
IMPLOT_API bool IsAxisHovered(ImAxis axis);
IMPLOT_API bool IsSubplotsHovered();
IMPLOT_API bool IsPlotSelected();
IMPLOT_API ImPlotRect GetPlotSelection(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
IMPLOT_API void CancelPlotSelection();
IMPLOT_API void HideNextItem(bool hidden = true, ImPlotCond cond = ImPlotCond_Once);
IMPLOT_API bool BeginAlignedPlots(const char* group_id, bool vertical = true);
IMPLOT_API void EndAlignedPlots();
IMPLOT_API bool BeginLegendPopup(const char* label_id, ImGuiMouseButton mouse_button=1);
IMPLOT_API void EndLegendPopup();
IMPLOT_API bool IsLegendEntryHovered(const char* label_id);
IMPLOT_API bool BeginDragDropTargetPlot();
IMPLOT_API bool BeginDragDropTargetAxis(ImAxis axis);
IMPLOT_API bool BeginDragDropTargetLegend();
IMPLOT_API void EndDragDropTarget();
IMPLOT_API bool BeginDragDropSourcePlot(ImGuiDragDropFlags flags=0);
IMPLOT_API bool BeginDragDropSourceAxis(ImAxis axis, ImGuiDragDropFlags flags=0);
IMPLOT_API bool BeginDragDropSourceItem(const char* label_id, ImGuiDragDropFlags flags=0);
IMPLOT_API void EndDragDropSource();
IMPLOT_API ImPlotStyle& GetStyle();
IMPLOT_API void StyleColorsAuto(ImPlotStyle* dst = nullptr);
IMPLOT_API void StyleColorsClassic(ImPlotStyle* dst = nullptr);
IMPLOT_API void StyleColorsDark(ImPlotStyle* dst = nullptr);
IMPLOT_API void StyleColorsLight(ImPlotStyle* dst = nullptr);
IMPLOT_API void PushStyleColor(ImPlotCol idx, ImU32 col);
IMPLOT_API void PushStyleColor(ImPlotCol idx, const ImVec4& col);
IMPLOT_API void PopStyleColor(int count = 1);
IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, float val);
IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, int val);
IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, const ImVec2& val);
IMPLOT_API void PopStyleVar(int count = 1);
IMPLOT_API ImVec4 GetLastItemColor();
IMPLOT_API const char* GetStyleColorName(ImPlotCol idx);
IMPLOT_API const char* GetMarkerName(ImPlotMarker idx);
IMPLOT_API ImPlotMarker NextMarker();
IMPLOT_API ImPlotColormap AddColormap(const char* name, const ImVec4* cols, int size, bool qual=true);
IMPLOT_API ImPlotColormap AddColormap(const char* name, const ImU32* cols, int size, bool qual=true);
IMPLOT_API int GetColormapCount();
IMPLOT_API const char* GetColormapName(ImPlotColormap cmap);
IMPLOT_API ImPlotColormap GetColormapIndex(const char* name);
IMPLOT_API void PushColormap(ImPlotColormap cmap);
IMPLOT_API void PushColormap(const char* name);
IMPLOT_API void PopColormap(int count = 1);
IMPLOT_API ImVec4 NextColormapColor();
IMPLOT_API int GetColormapSize(ImPlotColormap cmap = IMPLOT_AUTO);
IMPLOT_API ImVec4 GetColormapColor(int idx, ImPlotColormap cmap = IMPLOT_AUTO);
IMPLOT_API ImVec4 SampleColormap(float t, ImPlotColormap cmap = IMPLOT_AUTO);
IMPLOT_API void ColormapScale(const char* label, double scale_min, double scale_max, const ImVec2& size = ImVec2(0,0), const char* format = "%g", ImPlotColormapScaleFlags flags = 0, ImPlotColormap cmap = IMPLOT_AUTO);
IMPLOT_API bool ColormapSlider(const char* label, float* t, ImVec4* out = nullptr, const char* format = "", ImPlotColormap cmap = IMPLOT_AUTO);
IMPLOT_API bool ColormapButton(const char* label, const ImVec2& size = ImVec2(0,0), ImPlotColormap cmap = IMPLOT_AUTO);
IMPLOT_API void BustColorCache(const char* plot_title_id = nullptr);
IMPLOT_API ImPlotInputMap& GetInputMap();
IMPLOT_API void MapInputDefault(ImPlotInputMap* dst = nullptr);
IMPLOT_API void MapInputReverse(ImPlotInputMap* dst = nullptr);
IMPLOT_API void ItemIcon(const ImVec4& col);
IMPLOT_API void ItemIcon(ImU32 col);
IMPLOT_API void ColormapIcon(ImPlotColormap cmap);
IMPLOT_API ImDrawList* GetPlotDrawList();
IMPLOT_API void PushPlotClipRect(float expand=0);
IMPLOT_API void PopPlotClipRect();
IMPLOT_API bool ShowStyleSelector(const char* label);
IMPLOT_API bool ShowColormapSelector(const char* label);
IMPLOT_API bool ShowInputMapSelector(const char* label);
IMPLOT_API void ShowStyleEditor(ImPlotStyle* ref = nullptr);
IMPLOT_API void ShowUserGuide();
IMPLOT_API void ShowMetricsWindow(bool* p_popen = nullptr);
IMPLOT_API void ShowDemoWindow(bool* p_open = nullptr);
}
#ifndef IMPLOT_DISABLE_OBSOLETE_FUNCTIONS
#ifndef IMPLOT_DISABLE_DEPRECATED_WARNINGS
#if __cplusplus > 201402L
#define IMPLOT_DEPRECATED(method) [[deprecated]] method
#elif defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) && ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) )
#define IMPLOT_DEPRECATED(method) method __attribute__( ( deprecated ) )
#elif defined( _MSC_VER )
#define IMPLOT_DEPRECATED(method) __declspec(deprecated) method
#else
#define IMPLOT_DEPRECATED(method) method
#endif
#else
#define IMPLOT_DEPRECATED(method) method
#endif
namespace ImPlot {
}
#endif #endif