63 #define IMPLOT_VERSION "0.14"
65 #define IMPLOT_AUTO -1
67 #define IMPLOT_AUTO_COL ImVec4(0,0,0,-1)
69 #define IMPLOT_TMP template <typename T> IMPLOT_API
80 typedef int ImPlotFlags;
81 typedef int ImPlotAxisFlags;
82 typedef int ImPlotSubplotFlags;
83 typedef int ImPlotLegendFlags;
84 typedef int ImPlotMouseTextFlags;
85 typedef int ImPlotDragToolFlags;
86 typedef int ImPlotColormapScaleFlags;
88 typedef int ImPlotItemFlags;
89 typedef int ImPlotLineFlags;
90 typedef int ImPlotScatterFlags;
91 typedef int ImPlotStairsFlags;
92 typedef int ImPlotShadedFlags;
93 typedef int ImPlotBarsFlags;
94 typedef int ImPlotBarGroupsFlags;
95 typedef int ImPlotErrorBarsFlags;
96 typedef int ImPlotStemsFlags;
97 typedef int ImPlotInfLinesFlags;
98 typedef int ImPlotPieChartFlags;
99 typedef int ImPlotHeatmapFlags;
100 typedef int ImPlotHistogramFlags;
101 typedef int ImPlotDigitalFlags;
102 typedef int ImPlotImageFlags;
103 typedef int ImPlotTextFlags;
104 typedef int ImPlotDummyFlags;
106 typedef int ImPlotCond;
107 typedef int ImPlotCol;
108 typedef int ImPlotStyleVar;
109 typedef int ImPlotScale;
110 typedef int ImPlotMarker;
111 typedef int ImPlotColormap;
112 typedef int ImPlotLocation;
113 typedef int ImPlotBin;
131 ImPlotFlags_None = 0,
132 ImPlotFlags_NoTitle = 1 << 0,
133 ImPlotFlags_NoLegend = 1 << 1,
134 ImPlotFlags_NoMouseText = 1 << 2,
135 ImPlotFlags_NoInputs = 1 << 3,
136 ImPlotFlags_NoMenus = 1 << 4,
137 ImPlotFlags_NoBoxSelect = 1 << 5,
138 ImPlotFlags_NoChild = 1 << 6,
139 ImPlotFlags_NoFrame = 1 << 7,
140 ImPlotFlags_Equal = 1 << 8,
141 ImPlotFlags_Crosshairs = 1 << 9,
142 ImPlotFlags_CanvasOnly = ImPlotFlags_NoTitle | ImPlotFlags_NoLegend | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText
146 enum ImPlotAxisFlags_ {
147 ImPlotAxisFlags_None = 0,
148 ImPlotAxisFlags_NoLabel = 1 << 0,
149 ImPlotAxisFlags_NoGridLines = 1 << 1,
150 ImPlotAxisFlags_NoTickMarks = 1 << 2,
151 ImPlotAxisFlags_NoTickLabels = 1 << 3,
152 ImPlotAxisFlags_NoInitialFit = 1 << 4,
153 ImPlotAxisFlags_NoMenus = 1 << 5,
154 ImPlotAxisFlags_NoSideSwitch = 1 << 6,
155 ImPlotAxisFlags_NoHighlight = 1 << 7,
156 ImPlotAxisFlags_Opposite = 1 << 8,
157 ImPlotAxisFlags_Foreground = 1 << 9,
158 ImPlotAxisFlags_Invert = 1 << 10,
159 ImPlotAxisFlags_AutoFit = 1 << 11,
160 ImPlotAxisFlags_RangeFit = 1 << 12,
161 ImPlotAxisFlags_PanStretch = 1 << 13,
162 ImPlotAxisFlags_LockMin = 1 << 14,
163 ImPlotAxisFlags_LockMax = 1 << 15,
164 ImPlotAxisFlags_Lock = ImPlotAxisFlags_LockMin | ImPlotAxisFlags_LockMax,
165 ImPlotAxisFlags_NoDecorations = ImPlotAxisFlags_NoLabel | ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_NoTickMarks | ImPlotAxisFlags_NoTickLabels,
166 ImPlotAxisFlags_AuxDefault = ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_Opposite
170 enum ImPlotSubplotFlags_ {
171 ImPlotSubplotFlags_None = 0,
172 ImPlotSubplotFlags_NoTitle = 1 << 0,
173 ImPlotSubplotFlags_NoLegend = 1 << 1,
174 ImPlotSubplotFlags_NoMenus = 1 << 2,
175 ImPlotSubplotFlags_NoResize = 1 << 3,
176 ImPlotSubplotFlags_NoAlign = 1 << 4,
177 ImPlotSubplotFlags_ShareItems = 1 << 5,
178 ImPlotSubplotFlags_LinkRows = 1 << 6,
179 ImPlotSubplotFlags_LinkCols = 1 << 7,
180 ImPlotSubplotFlags_LinkAllX = 1 << 8,
181 ImPlotSubplotFlags_LinkAllY = 1 << 9,
182 ImPlotSubplotFlags_ColMajor = 1 << 10
186 enum ImPlotLegendFlags_ {
187 ImPlotLegendFlags_None = 0,
188 ImPlotLegendFlags_NoButtons = 1 << 0,
189 ImPlotLegendFlags_NoHighlightItem = 1 << 1,
190 ImPlotLegendFlags_NoHighlightAxis = 1 << 2,
191 ImPlotLegendFlags_NoMenus = 1 << 3,
192 ImPlotLegendFlags_Outside = 1 << 4,
193 ImPlotLegendFlags_Horizontal = 1 << 5,
194 ImPlotLegendFlags_Sort = 1 << 6,
198 enum ImPlotMouseTextFlags_ {
199 ImPlotMouseTextFlags_None = 0,
200 ImPlotMouseTextFlags_NoAuxAxes = 1 << 0,
201 ImPlotMouseTextFlags_NoFormat = 1 << 1,
202 ImPlotMouseTextFlags_ShowAlways = 1 << 2,
206 enum ImPlotDragToolFlags_ {
207 ImPlotDragToolFlags_None = 0,
208 ImPlotDragToolFlags_NoCursors = 1 << 0,
209 ImPlotDragToolFlags_NoFit = 1 << 1,
210 ImPlotDragToolFlags_NoInputs = 1 << 2,
211 ImPlotDragToolFlags_Delayed = 1 << 3,
215 enum ImPlotColormapScaleFlags_ {
216 ImPlotColormapScaleFlags_None = 0,
217 ImPlotColormapScaleFlags_NoLabel = 1 << 0,
218 ImPlotColormapScaleFlags_Opposite = 1 << 1,
219 ImPlotColormapScaleFlags_Invert = 1 << 2,
223 enum ImPlotItemFlags_ {
224 ImPlotItemFlags_None = 0,
225 ImPlotItemFlags_NoLegend = 1 << 0,
226 ImPlotItemFlags_NoFit = 1 << 1,
230 enum ImPlotLineFlags_ {
231 ImPlotLineFlags_None = 0,
232 ImPlotLineFlags_Segments = 1 << 10,
233 ImPlotLineFlags_Loop = 1 << 11,
234 ImPlotLineFlags_SkipNaN = 1 << 12,
235 ImPlotLineFlags_NoClip = 1 << 13,
236 ImPlotLineFlags_Shaded = 1 << 14,
240 enum ImPlotScatterFlags_ {
241 ImPlotScatterFlags_None = 0,
242 ImPlotScatterFlags_NoClip = 1 << 10,
246 enum ImPlotStairsFlags_ {
247 ImPlotStairsFlags_None = 0,
248 ImPlotStairsFlags_PreStep = 1 << 10,
249 ImPlotStairsFlags_Shaded = 1 << 11
253 enum ImPlotShadedFlags_ {
254 ImPlotShadedFlags_None = 0
258 enum ImPlotBarsFlags_ {
259 ImPlotBarsFlags_None = 0,
260 ImPlotBarsFlags_Horizontal = 1 << 10,
264 enum ImPlotBarGroupsFlags_ {
265 ImPlotBarGroupsFlags_None = 0,
266 ImPlotBarGroupsFlags_Horizontal = 1 << 10,
267 ImPlotBarGroupsFlags_Stacked = 1 << 11,
271 enum ImPlotErrorBarsFlags_ {
272 ImPlotErrorBarsFlags_None = 0,
273 ImPlotErrorBarsFlags_Horizontal = 1 << 10,
277 enum ImPlotStemsFlags_ {
278 ImPlotStemsFlags_None = 0,
279 ImPlotStemsFlags_Horizontal = 1 << 10,
283 enum ImPlotInfLinesFlags_ {
284 ImPlotInfLinesFlags_None = 0,
285 ImPlotInfLinesFlags_Horizontal = 1 << 10
289 enum ImPlotPieChartFlags_ {
290 ImPlotPieChartFlags_None = 0,
291 ImPlotPieChartFlags_Normalize = 1 << 10
295 enum ImPlotHeatmapFlags_ {
296 ImPlotHeatmapFlags_None = 0,
297 ImPlotHeatmapFlags_ColMajor = 1 << 10,
301 enum ImPlotHistogramFlags_ {
302 ImPlotHistogramFlags_None = 0,
303 ImPlotHistogramFlags_Horizontal = 1 << 10,
304 ImPlotHistogramFlags_Cumulative = 1 << 11,
305 ImPlotHistogramFlags_Density = 1 << 12,
306 ImPlotHistogramFlags_NoOutliers = 1 << 13,
307 ImPlotHistogramFlags_ColMajor = 1 << 14
311 enum ImPlotDigitalFlags_ {
312 ImPlotDigitalFlags_None = 0
316 enum ImPlotImageFlags_ {
317 ImPlotImageFlags_None = 0
321 enum ImPlotTextFlags_ {
322 ImPlotTextFlags_None = 0,
323 ImPlotTextFlags_Vertical = 1 << 10
327 enum ImPlotDummyFlags_ {
328 ImPlotDummyFlags_None = 0
334 ImPlotCond_None = ImGuiCond_None,
335 ImPlotCond_Always = ImGuiCond_Always,
336 ImPlotCond_Once = ImGuiCond_Once,
344 ImPlotCol_MarkerOutline,
345 ImPlotCol_MarkerFill,
350 ImPlotCol_PlotBorder,
352 ImPlotCol_LegendBorder,
353 ImPlotCol_LegendText,
360 ImPlotCol_AxisBgHovered,
361 ImPlotCol_AxisBgActive,
363 ImPlotCol_Crosshairs,
368 enum ImPlotStyleVar_ {
370 ImPlotStyleVar_LineWeight,
371 ImPlotStyleVar_Marker,
372 ImPlotStyleVar_MarkerSize,
373 ImPlotStyleVar_MarkerWeight,
374 ImPlotStyleVar_FillAlpha,
375 ImPlotStyleVar_ErrorBarSize,
376 ImPlotStyleVar_ErrorBarWeight,
377 ImPlotStyleVar_DigitalBitHeight,
378 ImPlotStyleVar_DigitalBitGap,
380 ImPlotStyleVar_PlotBorderSize,
381 ImPlotStyleVar_MinorAlpha,
382 ImPlotStyleVar_MajorTickLen,
383 ImPlotStyleVar_MinorTickLen,
384 ImPlotStyleVar_MajorTickSize,
385 ImPlotStyleVar_MinorTickSize,
386 ImPlotStyleVar_MajorGridSize,
387 ImPlotStyleVar_MinorGridSize,
388 ImPlotStyleVar_PlotPadding,
389 ImPlotStyleVar_LabelPadding,
390 ImPlotStyleVar_LegendPadding,
391 ImPlotStyleVar_LegendInnerPadding,
392 ImPlotStyleVar_LegendSpacing,
393 ImPlotStyleVar_MousePosPadding,
394 ImPlotStyleVar_AnnotationPadding,
395 ImPlotStyleVar_FitPadding,
396 ImPlotStyleVar_PlotDefaultSize,
397 ImPlotStyleVar_PlotMinSize,
403 ImPlotScale_Linear = 0,
411 ImPlotMarker_None = -1,
414 ImPlotMarker_Diamond,
421 ImPlotMarker_Asterisk,
426 enum ImPlotColormap_ {
427 ImPlotColormap_Deep = 0,
428 ImPlotColormap_Dark = 1,
429 ImPlotColormap_Pastel = 2,
430 ImPlotColormap_Paired = 3,
431 ImPlotColormap_Viridis = 4,
432 ImPlotColormap_Plasma = 5,
433 ImPlotColormap_Hot = 6,
434 ImPlotColormap_Cool = 7,
435 ImPlotColormap_Pink = 8,
436 ImPlotColormap_Jet = 9,
437 ImPlotColormap_Twilight = 10,
438 ImPlotColormap_RdBu = 11,
439 ImPlotColormap_BrBG = 12,
440 ImPlotColormap_PiYG = 13,
441 ImPlotColormap_Spectral = 14,
442 ImPlotColormap_Greys = 15,
446 enum ImPlotLocation_ {
447 ImPlotLocation_Center = 0,
448 ImPlotLocation_North = 1 << 0,
449 ImPlotLocation_South = 1 << 1,
450 ImPlotLocation_West = 1 << 2,
451 ImPlotLocation_East = 1 << 3,
452 ImPlotLocation_NorthWest = ImPlotLocation_North | ImPlotLocation_West,
453 ImPlotLocation_NorthEast = ImPlotLocation_North | ImPlotLocation_East,
454 ImPlotLocation_SouthWest = ImPlotLocation_South | ImPlotLocation_West,
455 ImPlotLocation_SouthEast = ImPlotLocation_South | ImPlotLocation_East
461 ImPlotBin_Sturges = -2,
463 ImPlotBin_Scott = -4,
470 ImPlotPoint(
double _x,
double _y) { x = _x; y = _y; }
472 double operator[] (
size_t idx)
const {
return (&x)[idx]; }
473 double& operator[] (
size_t idx) {
return (&x)[idx]; }
474 #ifdef IMPLOT_POINT_CLASS_EXTRA
475 IMPLOT_POINT_CLASS_EXTRA
484 ImPlotRange(
double _min,
double _max) { Min = _min; Max = _max; }
485 bool Contains(
double value)
const {
return value >= Min && value <= Max; }
486 double Size()
const {
return Max - Min; }
487 double Clamp(
double value)
const {
return (value < Min) ? Min : (value > Max) ? Max : value; }
494 ImPlotRect(
double x_min,
double x_max,
double y_min,
double y_max) { X.Min = x_min; X.Max = x_max; Y.Min = y_min; Y.Max = y_max; }
495 bool Contains(
const ImPlotPoint& p)
const {
return Contains(p.x, p.y); }
496 bool Contains(
double x,
double y)
const {
return X.Contains(x) && Y.Contains(y); }
513 float ErrorBarWeight;
514 float DigitalBitHeight;
517 float PlotBorderSize;
528 ImVec2 LegendInnerPadding;
536 ImVec4 Colors[ImPlotCol_COUNT];
538 ImPlotColormap Colormap;
547 #if (IMGUI_VERSION_NUM < 18716)
548 #define ImGuiMod_None 0
549 #define ImGuiMod_Ctrl ImGuiKeyModFlags_Ctrl
550 #define ImGuiMod_Shift ImGuiKeyModFlags_Shift
551 #define ImGuiMod_Alt ImGuiKeyModFlags_Alt
552 #define ImGuiMod_Super ImGuiKeyModFlags_Super
553 #elif (IMGUI_VERSION_NUM < 18823)
554 #define ImGuiMod_None 0
555 #define ImGuiMod_Ctrl ImGuiModFlags_Ctrl
556 #define ImGuiMod_Shift ImGuiModFlags_Shift
557 #define ImGuiMod_Alt ImGuiModFlags_Alt
558 #define ImGuiMod_Super ImGuiModFlags_Super
563 ImGuiMouseButton Pan;
565 ImGuiMouseButton Fit;
566 ImGuiMouseButton Select;
567 ImGuiMouseButton SelectCancel;
571 ImGuiMouseButton Menu;
583 typedef int (*ImPlotFormatter)(
double value,
char* buff,
int size,
void* user_data);
586 typedef ImPlotPoint (*ImPlotGetter)(
int idx,
void* user_data);
589 typedef double (*ImPlotTransform)(
double value,
void* user_data);
632 IMPLOT_API
bool BeginPlot(
const char* title_id,
const ImVec2& size=
ImVec2(-1,0), ImPlotFlags flags=0);
636 IMPLOT_API
void EndPlot();
688 IMPLOT_API
bool BeginSubplots(
const char* title_id,
692 ImPlotSubplotFlags flags = 0,
693 float* row_ratios = NULL,
694 float* col_ratios = NULL);
698 IMPLOT_API
void EndSubplots();
730 IMPLOT_API
void SetupAxis(ImAxis axis,
const char* label=NULL, ImPlotAxisFlags flags=0);
732 IMPLOT_API
void SetupAxisLimits(ImAxis axis,
double v_min,
double v_max, ImPlotCond cond = ImPlotCond_Once);
734 IMPLOT_API
void SetupAxisLinks(ImAxis axis,
double* link_min,
double* link_max);
736 IMPLOT_API
void SetupAxisFormat(ImAxis axis,
const char* fmt);
738 IMPLOT_API
void SetupAxisFormat(ImAxis axis, ImPlotFormatter formatter,
void* data=NULL);
740 IMPLOT_API
void SetupAxisTicks(ImAxis axis,
const double* values,
int n_ticks,
const char*
const labels[]=NULL,
bool keep_default=
false);
742 IMPLOT_API
void SetupAxisTicks(ImAxis axis,
double v_min,
double v_max,
int n_ticks,
const char*
const labels[]=NULL,
bool keep_default=
false);
744 IMPLOT_API
void SetupAxisScale(ImAxis axis, ImPlotScale scale);
746 IMPLOT_API
void SetupAxisScale(ImAxis axis, ImPlotTransform forward, ImPlotTransform inverse,
void* data=NULL);
748 IMPLOT_API
void SetupAxisLimitsConstraints(ImAxis axis,
double v_min,
double v_max);
750 IMPLOT_API
void SetupAxisZoomConstraints(ImAxis axis,
double z_min,
double z_max);
753 IMPLOT_API
void SetupAxes(
const char* x_label,
const char* y_label, ImPlotAxisFlags x_flags=0, ImPlotAxisFlags y_flags=0);
755 IMPLOT_API
void SetupAxesLimits(
double x_min,
double x_max,
double y_min,
double y_max, ImPlotCond cond = ImPlotCond_Once);
758 IMPLOT_API
void SetupLegend(ImPlotLocation location, ImPlotLegendFlags flags=0);
760 IMPLOT_API
void SetupMouseText(ImPlotLocation location, ImPlotMouseTextFlags flags=0);
764 IMPLOT_API
void SetupFinish();
790 IMPLOT_API
void SetNextAxisLimits(ImAxis axis,
double v_min,
double v_max, ImPlotCond cond = ImPlotCond_Once);
792 IMPLOT_API
void SetNextAxisLinks(ImAxis axis,
double* link_min,
double* link_max);
794 IMPLOT_API
void SetNextAxisToFit(ImAxis axis);
797 IMPLOT_API
void SetNextAxesLimits(
double x_min,
double x_max,
double y_min,
double y_max, ImPlotCond cond = ImPlotCond_Once);
799 IMPLOT_API
void SetNextAxesToFit();
854 IMPLOT_TMP
void PlotLine(
const char* label_id,
const T* values,
int count,
double xscale=1,
double xstart=0, ImPlotLineFlags flags=0,
int offset=0,
int stride=
sizeof(T));
855 IMPLOT_TMP
void PlotLine(
const char* label_id,
const T* xs,
const T* ys,
int count, ImPlotLineFlags flags=0,
int offset=0,
int stride=
sizeof(T));
856 IMPLOT_API
void PlotLineG(
const char* label_id, ImPlotGetter getter,
void* data,
int count, ImPlotLineFlags flags=0);
859 IMPLOT_TMP
void PlotScatter(
const char* label_id,
const T* values,
int count,
double xscale=1,
double xstart=0, ImPlotScatterFlags flags=0,
int offset=0,
int stride=
sizeof(T));
860 IMPLOT_TMP
void PlotScatter(
const char* label_id,
const T* xs,
const T* ys,
int count, ImPlotScatterFlags flags=0,
int offset=0,
int stride=
sizeof(T));
861 IMPLOT_API
void PlotScatterG(
const char* label_id, ImPlotGetter getter,
void* data,
int count, ImPlotScatterFlags flags=0);
864 IMPLOT_TMP
void PlotStairs(
const char* label_id,
const T* values,
int count,
double xscale=1,
double xstart=0, ImPlotStairsFlags flags=0,
int offset=0,
int stride=
sizeof(T));
865 IMPLOT_TMP
void PlotStairs(
const char* label_id,
const T* xs,
const T* ys,
int count, ImPlotStairsFlags flags=0,
int offset=0,
int stride=
sizeof(T));
866 IMPLOT_API
void PlotStairsG(
const char* label_id, ImPlotGetter getter,
void* data,
int count, ImPlotStairsFlags flags=0);
869 IMPLOT_TMP
void PlotShaded(
const char* label_id,
const T* values,
int count,
double yref=0,
double xscale=1,
double xstart=0, ImPlotShadedFlags flags=0,
int offset=0,
int stride=
sizeof(T));
870 IMPLOT_TMP
void PlotShaded(
const char* label_id,
const T* xs,
const T* ys,
int count,
double yref=0, ImPlotShadedFlags flags=0,
int offset=0,
int stride=
sizeof(T));
871 IMPLOT_TMP
void PlotShaded(
const char* label_id,
const T* xs,
const T* ys1,
const T* ys2,
int count, ImPlotShadedFlags flags=0,
int offset=0,
int stride=
sizeof(T));
872 IMPLOT_API
void PlotShadedG(
const char* label_id, ImPlotGetter getter1,
void* data1, ImPlotGetter getter2,
void* data2,
int count, ImPlotShadedFlags flags=0);
875 IMPLOT_TMP
void PlotBars(
const char* label_id,
const T* values,
int count,
double bar_size=0.67,
double shift=0, ImPlotBarsFlags flags=0,
int offset=0,
int stride=
sizeof(T));
876 IMPLOT_TMP
void PlotBars(
const char* label_id,
const T* xs,
const T* ys,
int count,
double bar_size, ImPlotBarsFlags flags=0,
int offset=0,
int stride=
sizeof(T));
877 IMPLOT_API
void PlotBarsG(
const char* label_id, ImPlotGetter getter,
void* data,
int count,
double bar_size, ImPlotBarsFlags flags=0);
880 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, ImPlotBarGroupsFlags flags=0);
883 IMPLOT_TMP
void PlotErrorBars(
const char* label_id,
const T* xs,
const T* ys,
const T* err,
int count, ImPlotErrorBarsFlags flags=0,
int offset=0,
int stride=
sizeof(T));
884 IMPLOT_TMP
void PlotErrorBars(
const char* label_id,
const T* xs,
const T* ys,
const T* neg,
const T* pos,
int count, ImPlotErrorBarsFlags flags=0,
int offset=0,
int stride=
sizeof(T));
887 IMPLOT_TMP
void PlotStems(
const char* label_id,
const T* values,
int count,
double ref=0,
double scale=1,
double start=0, ImPlotStemsFlags flags=0,
int offset=0,
int stride=
sizeof(T));
888 IMPLOT_TMP
void PlotStems(
const char* label_id,
const T* xs,
const T* ys,
int count,
double ref=0, ImPlotStemsFlags flags=0,
int offset=0,
int stride=
sizeof(T));
891 IMPLOT_TMP
void PlotInfLines(
const char* label_id,
const T* values,
int count, ImPlotInfLinesFlags flags=0,
int offset=0,
int stride=
sizeof(T));
894 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, ImPlotPieChartFlags flags=0);
897 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), ImPlotHeatmapFlags flags=0);
901 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(), ImPlotHistogramFlags flags=0);
905 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(), ImPlotHistogramFlags flags=0);
908 IMPLOT_TMP
void PlotDigital(
const char* label_id,
const T* xs,
const T* ys,
int count, ImPlotDigitalFlags flags=0,
int offset=0,
int stride=
sizeof(T));
909 IMPLOT_API
void PlotDigitalG(
const char* label_id, ImPlotGetter getter,
void* data,
int count, ImPlotDigitalFlags flags=0);
912 IMPLOT_API
void PlotImage(
const char* label_id, ImTextureID user_texture_id,
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), ImPlotImageFlags flags=0);
915 IMPLOT_API
void PlotText(
const char* text,
double x,
double y,
const ImVec2& pix_offset=
ImVec2(0,0), ImPlotTextFlags flags=0);
918 IMPLOT_API
void PlotDummy(
const char* label_id, ImPlotDummyFlags flags=0);
929 IMPLOT_API
bool DragPoint(
int id,
double* x,
double* y,
const ImVec4& col,
float size = 4, ImPlotDragToolFlags flags=0);
931 IMPLOT_API
bool DragLineX(
int id,
double* x,
const ImVec4& col,
float thickness = 1, ImPlotDragToolFlags flags=0);
933 IMPLOT_API
bool DragLineY(
int id,
double* y,
const ImVec4& col,
float thickness = 1, ImPlotDragToolFlags flags=0);
935 IMPLOT_API
bool DragRect(
int id,
double* x1,
double* y1,
double* x2,
double* y2,
const ImVec4& col, ImPlotDragToolFlags flags=0);
938 IMPLOT_API
void Annotation(
double x,
double y,
const ImVec4& col,
const ImVec2& pix_offset,
bool clamp,
bool round =
false);
939 IMPLOT_API
void Annotation(
double x,
double y,
const ImVec4& col,
const ImVec2& pix_offset,
bool clamp,
const char* fmt, ...) IM_FMTARGS(6);
940 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);
943 IMPLOT_API
void TagX(
double x, const
ImVec4& col,
bool round = false);
944 IMPLOT_API
void TagX(
double x, const
ImVec4& col, const
char* fmt, ...) IM_FMTARGS(3);
945 IMPLOT_API
void TagXV(
double x, const
ImVec4& col, const
char* fmt, va_list args) IM_FMTLIST(3);
948 IMPLOT_API
void TagY(
double y, const
ImVec4& col,
bool round = false);
949 IMPLOT_API
void TagY(
double y, const
ImVec4& col, const
char* fmt, ...) IM_FMTARGS(3);
950 IMPLOT_API
void TagYV(
double y, const
ImVec4& col, const
char* fmt, va_list args) IM_FMTLIST(3);
957 IMPLOT_API
void SetAxis(ImAxis axis);
958 IMPLOT_API
void SetAxes(ImAxis x_axis, ImAxis y_axis);
961 IMPLOT_API
ImPlotPoint PixelsToPlot(const
ImVec2& pix, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
962 IMPLOT_API
ImPlotPoint PixelsToPlot(
float x,
float y, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
965 IMPLOT_API
ImVec2 PlotToPixels(const
ImPlotPoint& plt, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
966 IMPLOT_API
ImVec2 PlotToPixels(
double x,
double y, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
969 IMPLOT_API
ImVec2 GetPlotPos();
971 IMPLOT_API
ImVec2 GetPlotSize();
974 IMPLOT_API
ImPlotPoint GetPlotMousePos(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
976 IMPLOT_API
ImPlotRect GetPlotLimits(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
979 IMPLOT_API
bool IsPlotHovered();
981 IMPLOT_API
bool IsAxisHovered(ImAxis axis);
983 IMPLOT_API
bool IsSubplotsHovered();
986 IMPLOT_API
bool IsPlotSelected();
988 IMPLOT_API
ImPlotRect GetPlotSelection(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO);
990 IMPLOT_API
void CancelPlotSelection();
994 IMPLOT_API
void HideNextItem(
bool hidden = true, ImPlotCond cond = ImPlotCond_Once);
1003 IMPLOT_API
bool BeginAlignedPlots(const
char* group_id,
bool vertical = true);
1005 IMPLOT_API
void EndAlignedPlots();
1012 IMPLOT_API
bool BeginLegendPopup(const
char* label_id, ImGuiMouseButton mouse_button=1);
1014 IMPLOT_API
void EndLegendPopup();
1016 IMPLOT_API
bool IsLegendEntryHovered(const
char* label_id);
1023 IMPLOT_API
bool BeginDragDropTargetPlot();
1025 IMPLOT_API
bool BeginDragDropTargetAxis(ImAxis axis);
1027 IMPLOT_API
bool BeginDragDropTargetLegend();
1029 IMPLOT_API
void EndDragDropTarget();
1035 IMPLOT_API
bool BeginDragDropSourcePlot(ImGuiDragDropFlags flags=0);
1037 IMPLOT_API
bool BeginDragDropSourceAxis(ImAxis axis, ImGuiDragDropFlags flags=0);
1039 IMPLOT_API
bool BeginDragDropSourceItem(const
char* label_id, ImGuiDragDropFlags flags=0);
1041 IMPLOT_API
void EndDragDropSource();
1080 IMPLOT_API
void StyleColorsAuto(
ImPlotStyle* dst = NULL);
1082 IMPLOT_API
void StyleColorsClassic(
ImPlotStyle* dst = NULL);
1084 IMPLOT_API
void StyleColorsDark(
ImPlotStyle* dst = NULL);
1086 IMPLOT_API
void StyleColorsLight(
ImPlotStyle* dst = NULL);
1093 IMPLOT_API
void PushStyleColor(ImPlotCol idx, ImU32 col);
1094 IMPLOT_API
void PushStyleColor(ImPlotCol idx, const
ImVec4& col);
1096 IMPLOT_API
void PopStyleColor(
int count = 1);
1099 IMPLOT_API
void PushStyleVar(ImPlotStyleVar idx,
float val);
1101 IMPLOT_API
void PushStyleVar(ImPlotStyleVar idx,
int val);
1103 IMPLOT_API
void PushStyleVar(ImPlotStyleVar idx, const
ImVec2& val);
1105 IMPLOT_API
void PopStyleVar(
int count = 1);
1113 IMPLOT_API
void SetNextLineStyle(const
ImVec4& col = IMPLOT_AUTO_COL,
float weight = IMPLOT_AUTO);
1115 IMPLOT_API
void SetNextFillStyle(const
ImVec4& col = IMPLOT_AUTO_COL,
float alpha_mod = IMPLOT_AUTO);
1117 IMPLOT_API
void SetNextMarkerStyle(ImPlotMarker marker = IMPLOT_AUTO,
float size = IMPLOT_AUTO, const
ImVec4& fill = IMPLOT_AUTO_COL,
float weight = IMPLOT_AUTO, const
ImVec4& outline = IMPLOT_AUTO_COL);
1119 IMPLOT_API
void SetNextErrorBarStyle(const
ImVec4& col = IMPLOT_AUTO_COL,
float size = IMPLOT_AUTO,
float weight = IMPLOT_AUTO);
1122 IMPLOT_API
ImVec4 GetLastItemColor();
1125 IMPLOT_API const
char* GetStyleColorName(ImPlotCol idx);
1127 IMPLOT_API const
char* GetMarkerName(ImPlotMarker idx);
1148 IMPLOT_API ImPlotColormap AddColormap(const
char* name, const
ImVec4* cols,
int size,
bool qual=true);
1149 IMPLOT_API ImPlotColormap AddColormap(const
char* name, const ImU32* cols,
int size,
bool qual=true);
1152 IMPLOT_API
int GetColormapCount();
1154 IMPLOT_API const
char* GetColormapName(ImPlotColormap cmap);
1156 IMPLOT_API ImPlotColormap GetColormapIndex(const
char* name);
1159 IMPLOT_API
void PushColormap(ImPlotColormap cmap);
1161 IMPLOT_API
void PushColormap(const
char* name);
1163 IMPLOT_API
void PopColormap(
int count = 1);
1167 IMPLOT_API
ImVec4 NextColormapColor();
1173 IMPLOT_API
int GetColormapSize(ImPlotColormap cmap = IMPLOT_AUTO);
1175 IMPLOT_API
ImVec4 GetColormapColor(
int idx, ImPlotColormap cmap = IMPLOT_AUTO);
1177 IMPLOT_API
ImVec4 SampleColormap(
float t, ImPlotColormap cmap = IMPLOT_AUTO);
1180 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);
1182 IMPLOT_API
bool ColormapSlider(const
char* label,
float* t,
ImVec4* out = NULL, const
char* format = "", ImPlotColormap cmap = IMPLOT_AUTO);
1184 IMPLOT_API
bool ColormapButton(const
char* label, const
ImVec2& size =
ImVec2(0,0), ImPlotColormap cmap = IMPLOT_AUTO);
1193 IMPLOT_API
void BustColorCache(const
char* plot_title_id = NULL);
1212 IMPLOT_API
void ItemIcon(const
ImVec4& col);
1213 IMPLOT_API
void ItemIcon(ImU32 col);
1214 IMPLOT_API
void ColormapIcon(ImPlotColormap cmap);
1219 IMPLOT_API
void PushPlotClipRect(
float expand=0);
1221 IMPLOT_API
void PopPlotClipRect();
1224 IMPLOT_API
bool ShowStyleSelector(const
char* label);
1226 IMPLOT_API
bool ShowColormapSelector(const
char* label);
1228 IMPLOT_API
bool ShowInputMapSelector(const
char* label);
1230 IMPLOT_API
void ShowStyleEditor(
ImPlotStyle* ref = NULL);
1232 IMPLOT_API
void ShowUserGuide();
1234 IMPLOT_API
void ShowMetricsWindow(
bool* p_popen = NULL);
1241 IMPLOT_API
void ShowDemoWindow(
bool* p_open = NULL);
1254 #ifndef IMPLOT_DISABLE_OBSOLETE_FUNCTIONS
1256 #ifndef IMPLOT_DISABLE_DEPRECATED_WARNINGS
1257 #if __cplusplus > 201402L
1258 #define IMPLOT_DEPRECATED(method) [[deprecated]] method
1259 #elif defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) && ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) )
1260 #define IMPLOT_DEPRECATED(method) method __attribute__( ( deprecated ) )
1261 #elif defined( _MSC_VER )
1262 #define IMPLOT_DEPRECATED(method) __declspec(deprecated) method
1264 #define IMPLOT_DEPRECATED(method) method
1267 #define IMPLOT_DEPRECATED(method) method
1270 enum ImPlotFlagsObsolete_ {
1271 ImPlotFlags_YAxis2 = 1 << 20,
1272 ImPlotFlags_YAxis3 = 1 << 21,
1278 IMPLOT_DEPRECATED( IMPLOT_API
bool BeginPlot(
const char* title_id,
1279 const char* x_label,
1280 const char* y_label,
1282 ImPlotFlags flags = ImPlotFlags_None,
1283 ImPlotAxisFlags x_flags = 0,
1284 ImPlotAxisFlags y_flags = 0,
1285 ImPlotAxisFlags y2_flags = ImPlotAxisFlags_AuxDefault,
1286 ImPlotAxisFlags y3_flags = ImPlotAxisFlags_AuxDefault,
1287 const char* y2_label = NULL,
1288 const char* y3_label = NULL) );
Definition: imgui_internal.h:1732
Definition: implot_internal.h:1205