2020-04-27 11:27:59 -04:00
// MIT License
2021-03-17 08:38:45 -04:00
// Copyright (c) 2021 Evan Pezent
2020-04-27 11:27:59 -04:00
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
2021-03-20 22:45:31 -04:00
// ImPlot v0.10 WIP
2020-04-27 11:27:59 -04:00
# pragma once
2020-05-10 22:43:12 -04:00
# include "imgui.h"
2020-04-27 11:27:59 -04:00
2020-08-30 18:12:36 -04:00
//-----------------------------------------------------------------------------
// Macros and Defines
//-----------------------------------------------------------------------------
2020-09-07 21:59:43 -04:00
// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
// Using ImPlot via a shared library is not recommended, because we don't guarantee
// backward nor forward ABI compatibility and also function call overhead. If you
2021-03-17 08:38:45 -04:00
// do use ImPlot as a DLL, be sure to call SetImGuiContext (see Miscellanous section).
2020-09-07 21:59:43 -04:00
# ifndef IMPLOT_API
# define IMPLOT_API
# endif
2020-08-30 18:12:36 -04:00
// ImPlot version string
2021-03-20 23:22:18 -04:00
# define IMPLOT_VERSION "0.10 WIP"
2020-08-30 18:12:36 -04:00
// Indicates variable should deduced automatically.
# define IMPLOT_AUTO -1
2020-09-01 00:23:48 -04:00
// Special color used to indicate that a color should be deduced automatically.
2020-08-30 18:12:36 -04:00
# define IMPLOT_AUTO_COL ImVec4(0,0,0,-1)
2020-08-16 16:38:51 -04:00
2020-04-27 11:27:59 -04:00
//-----------------------------------------------------------------------------
2020-08-16 16:38:51 -04:00
// Forward Declarations and Basic Types
2020-04-27 11:27:59 -04:00
//-----------------------------------------------------------------------------
2020-08-16 11:25:06 -04:00
// Forward declarations
2020-08-16 16:38:51 -04:00
struct ImPlotContext ; // ImPlot context (opaque struct, see implot_internal.h)
2020-08-16 11:25:06 -04:00
// Enums/Flags
typedef int ImPlotFlags ; // -> enum ImPlotFlags_
typedef int ImPlotAxisFlags ; // -> enum ImPlotAxisFlags_
typedef int ImPlotCol ; // -> enum ImPlotCol_
typedef int ImPlotStyleVar ; // -> enum ImPlotStyleVar_
typedef int ImPlotMarker ; // -> enum ImPlotMarker_
typedef int ImPlotColormap ; // -> enum ImPlotColormap_
2020-10-19 00:26:34 -04:00
typedef int ImPlotLocation ; // -> enum ImPlotLocation_
typedef int ImPlotOrientation ; // -> enum ImPlotOrientation_
typedef int ImPlotYAxis ; // -> enum ImPlotYAxis_;
2021-03-17 08:38:45 -04:00
typedef int ImPlotBin ; // -> enum ImPlotBin_
2020-04-27 11:27:59 -04:00
2020-05-31 10:28:34 -04:00
// Options for plots.
2020-04-27 11:27:59 -04:00
enum ImPlotFlags_ {
2020-09-06 01:42:03 -04:00
ImPlotFlags_None = 0 , // default
2020-11-10 09:27:28 -05:00
ImPlotFlags_NoTitle = 1 < < 0 , // the plot title will not be displayed (titles are also hidden if preceeded by double hashes, e.g. "##MyPlot")
ImPlotFlags_NoLegend = 1 < < 1 , // the legend will not be displayed
2021-01-18 22:49:23 -05:00
ImPlotFlags_NoMenus = 1 < < 2 , // the user will not be able to open context menus with right-click
ImPlotFlags_NoBoxSelect = 1 < < 3 , // the user will not be able to box-select with right-click drag
2020-11-10 09:27:28 -05:00
ImPlotFlags_NoMousePos = 1 < < 4 , // the mouse position, in plot coordinates, will not be displayed inside of the plot
ImPlotFlags_NoHighlight = 1 < < 5 , // plot items will not be highlighted when their legend entry is hovered
ImPlotFlags_NoChild = 1 < < 6 , // a child window region will not be used to capture mouse scroll (can boost performance for single ImGui window applications)
2021-01-18 22:49:23 -05:00
ImPlotFlags_Equal = 1 < < 7 , // primary x and y axes will be constrained to have the same units/pixel (does not apply to auxiliary y-axes)
2020-11-15 22:47:06 -05:00
ImPlotFlags_YAxis2 = 1 < < 8 , // enable a 2nd y-axis on the right side
ImPlotFlags_YAxis3 = 1 < < 9 , // enable a 3rd y-axis on the right side
2021-01-18 22:49:23 -05:00
ImPlotFlags_Query = 1 < < 10 , // the user will be able to draw query rects with middle-mouse or CTRL + right-click drag
2020-11-15 22:47:06 -05:00
ImPlotFlags_Crosshairs = 1 < < 11 , // the default mouse cursor will be replaced with a crosshair when hovered
2021-01-18 22:49:23 -05:00
ImPlotFlags_AntiAliased = 1 < < 12 , // plot lines will be software anti-aliased (not recommended for high density plots, prefer MSAA)
2020-11-10 09:27:28 -05:00
ImPlotFlags_CanvasOnly = ImPlotFlags_NoTitle | ImPlotFlags_NoLegend | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMousePos
2020-04-27 11:27:59 -04:00
} ;
2020-05-31 10:28:34 -04:00
// Options for plot axes (X and Y).
2020-05-13 10:08:12 -04:00
enum ImPlotAxisFlags_ {
2020-09-06 02:38:18 -04:00
ImPlotAxisFlags_None = 0 , // default
2021-01-18 22:49:23 -05:00
ImPlotAxisFlags_NoLabel = 1 < < 0 , // the axis label will not be displayed (axis labels also hidden if the supplied string name is NULL)
2021-03-17 08:38:45 -04:00
ImPlotAxisFlags_NoGridLines = 1 < < 1 , // no grid lines will be displayed
ImPlotAxisFlags_NoTickMarks = 1 < < 2 , // no tick marks will be displayed
ImPlotAxisFlags_NoTickLabels = 1 < < 3 , // no text labels will be displayed
2021-01-06 10:34:03 -05:00
ImPlotAxisFlags_LogScale = 1 < < 4 , // a logartithmic (base 10) axis scale will be used (mutually exclusive with ImPlotAxisFlags_Time)
ImPlotAxisFlags_Time = 1 < < 5 , // axis will display date/time formatted labels (mutually exclusive with ImPlotAxisFlags_LogScale)
ImPlotAxisFlags_Invert = 1 < < 6 , // the axis will be inverted
2021-03-17 08:38:45 -04:00
ImPlotAxisFlags_AutoFit = 1 < < 7 , // axis will be auto-fitting to data extents
ImPlotAxisFlags_LockMin = 1 < < 8 , // the axis minimum value will be locked when panning/zooming
ImPlotAxisFlags_LockMax = 1 < < 9 , // the axis maximum value will be locked when panning/zooming
2020-09-06 02:38:18 -04:00
ImPlotAxisFlags_Lock = ImPlotAxisFlags_LockMin | ImPlotAxisFlags_LockMax ,
2021-01-06 10:34:03 -05:00
ImPlotAxisFlags_NoDecorations = ImPlotAxisFlags_NoLabel | ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_NoTickMarks | ImPlotAxisFlags_NoTickLabels
2020-04-27 11:27:59 -04:00
} ;
2020-05-31 10:28:34 -04:00
// Plot styling colors.
2020-04-27 11:27:59 -04:00
enum ImPlotCol_ {
2020-09-01 00:23:48 -04:00
// item styling colors
2020-06-08 21:26:15 -04:00
ImPlotCol_Line , // plot line/outline color (defaults to next unused color in current colormap)
2020-04-27 11:27:59 -04:00
ImPlotCol_Fill , // plot fill color for bars (defaults to the current line color)
ImPlotCol_MarkerOutline , // marker outline color (defaults to the current line color)
ImPlotCol_MarkerFill , // marker fill color (defaults to the current line color)
ImPlotCol_ErrorBar , // error bar color (defaults to ImGuiCol_Text)
2020-09-01 00:23:48 -04:00
// plot styling colors
2020-04-27 11:27:59 -04:00
ImPlotCol_FrameBg , // plot frame background color (defaults to ImGuiCol_FrameBg)
ImPlotCol_PlotBg , // plot area background color (defaults to ImGuiCol_WindowBg)
2020-08-24 12:06:29 -04:00
ImPlotCol_PlotBorder , // plot area border color (defaults to ImGuiCol_Border)
2020-08-24 00:45:42 -04:00
ImPlotCol_LegendBg , // legend background color (defaults to ImGuiCol_PopupBg)
ImPlotCol_LegendBorder , // legend border color (defaults to ImPlotCol_PlotBorder)
ImPlotCol_LegendText , // legend text color (defaults to ImPlotCol_InlayText)
ImPlotCol_TitleText , // plot title text color (defaults to ImGuiCol_Text)
ImPlotCol_InlayText , // color of text appearing inside of plots (defaults to ImGuiCol_Text)
ImPlotCol_XAxis , // x-axis label and tick lables color (defaults to ImGuiCol_Text)
ImPlotCol_XAxisGrid , // x-axis grid color (defaults to 25% ImPlotCol_XAxis)
ImPlotCol_YAxis , // y-axis label and tick labels color (defaults to ImGuiCol_Text)
ImPlotCol_YAxisGrid , // y-axis grid color (defaults to 25% ImPlotCol_YAxis)
ImPlotCol_YAxis2 , // 2nd y-axis label and tick labels color (defaults to ImGuiCol_Text)
ImPlotCol_YAxisGrid2 , // 2nd y-axis grid/label color (defaults to 25% ImPlotCol_YAxis2)
ImPlotCol_YAxis3 , // 3rd y-axis label and tick labels color (defaults to ImGuiCol_Text)
ImPlotCol_YAxisGrid3 , // 3rd y-axis grid/label color (defaults to 25% ImPlotCol_YAxis3)
2020-04-27 11:27:59 -04:00
ImPlotCol_Selection , // box-selection color (defaults to yellow)
2020-04-28 00:57:49 -04:00
ImPlotCol_Query , // box-query color (defaults to green)
2020-08-24 00:45:42 -04:00
ImPlotCol_Crosshairs , // crosshairs color (defaults to ImPlotCol_PlotBorder)
2020-04-27 11:27:59 -04:00
ImPlotCol_COUNT
} ;
2020-05-31 10:28:34 -04:00
// Plot styling variables.
2020-04-27 11:27:59 -04:00
enum ImPlotStyleVar_ {
2020-08-24 00:45:42 -04:00
// item styling variables
2020-10-19 00:26:34 -04:00
ImPlotStyleVar_LineWeight , // float, plot item line weight in pixels
ImPlotStyleVar_Marker , // int, marker specification
ImPlotStyleVar_MarkerSize , // float, marker size in pixels (roughly the marker's "radius")
ImPlotStyleVar_MarkerWeight , // float, plot outline weight of markers in pixels
ImPlotStyleVar_FillAlpha , // float, alpha modifier applied to all plot item fills
ImPlotStyleVar_ErrorBarSize , // float, error bar whisker width in pixels
ImPlotStyleVar_ErrorBarWeight , // float, error bar whisker weight in pixels
ImPlotStyleVar_DigitalBitHeight , // float, digital channels bit height (at 1) in pixels
ImPlotStyleVar_DigitalBitGap , // float, digital channels bit padding gap in pixels
2020-08-24 00:45:42 -04:00
// plot styling variables
2020-10-19 00:26:34 -04:00
ImPlotStyleVar_PlotBorderSize , // float, thickness of border around plot area
ImPlotStyleVar_MinorAlpha , // float, alpha multiplier applied to minor axis grid lines
ImPlotStyleVar_MajorTickLen , // ImVec2, major tick lengths for X and Y axes
ImPlotStyleVar_MinorTickLen , // ImVec2, minor tick lengths for X and Y axes
ImPlotStyleVar_MajorTickSize , // ImVec2, line thickness of major ticks
ImPlotStyleVar_MinorTickSize , // ImVec2, line thickness of minor ticks
ImPlotStyleVar_MajorGridSize , // ImVec2, line thickness of major grid lines
ImPlotStyleVar_MinorGridSize , // ImVec2, line thickness of minor grid lines
ImPlotStyleVar_PlotPadding , // ImVec2, padding between widget frame and plot area, labels, or outside legends (i.e. main padding)
ImPlotStyleVar_LabelPadding , // ImVec2, padding between axes labels, tick labels, and plot edge
ImPlotStyleVar_LegendPadding , // ImVec2, legend padding from plot edges
ImPlotStyleVar_LegendInnerPadding , // ImVec2, legend inner padding from legend edges
ImPlotStyleVar_LegendSpacing , // ImVec2, spacing between legend entries
ImPlotStyleVar_MousePosPadding , // ImVec2, padding between plot edge and interior info text
ImPlotStyleVar_AnnotationPadding , // ImVec2, text padding around annotation labels
2020-12-04 00:27:38 -05:00
ImPlotStyleVar_FitPadding , // ImVec2, additional fit padding as a percentage of the fit extents (e.g. ImVec2(0.1f,0.1f) adds 10% to the fit extents of X and Y)
2020-10-19 00:26:34 -04:00
ImPlotStyleVar_PlotDefaultSize , // ImVec2, default size used when ImVec2(0,0) is passed to BeginPlot
ImPlotStyleVar_PlotMinSize , // ImVec2, minimum size plot frame can be when shrunk
2020-04-27 11:27:59 -04:00
ImPlotStyleVar_COUNT
} ;
2020-08-28 18:11:36 -04:00
// Marker specifications.
2020-05-13 10:08:12 -04:00
enum ImPlotMarker_ {
2020-09-01 00:23:48 -04:00
ImPlotMarker_None = - 1 , // no marker
2020-08-28 18:11:36 -04:00
ImPlotMarker_Circle , // a circle marker
ImPlotMarker_Square , // a square maker
ImPlotMarker_Diamond , // a diamond marker
ImPlotMarker_Up , // an upward-pointing triangle marker
ImPlotMarker_Down , // an downward-pointing triangle marker
ImPlotMarker_Left , // an leftward-pointing triangle marker
ImPlotMarker_Right , // an rightward-pointing triangle marker
ImPlotMarker_Cross , // a cross marker (not fillable)
ImPlotMarker_Plus , // a plus marker (not fillable)
ImPlotMarker_Asterisk , // a asterisk marker (not fillable)
ImPlotMarker_COUNT
2020-04-27 11:27:59 -04:00
} ;
2020-06-01 23:14:22 -04:00
// Built-in colormaps
enum ImPlotColormap_ {
2021-03-17 08:38:45 -04:00
ImPlotColormap_Deep = 0 , // a.k.a. seaborn deep (qual=true, n=10) (default)
ImPlotColormap_Dark = 1 , // a.k.a. matplotlib "Set1" (qual=true, n=9 )
ImPlotColormap_Pastel = 2 , // a.k.a. matplotlib "Pastel1" (qual=true, n=9 )
ImPlotColormap_Paired = 3 , // a.k.a. matplotlib "Paired" (qual=true, n=12)
ImPlotColormap_Viridis = 4 , // a.k.a. matplotlib "viridis" (qual=false, n=11)
ImPlotColormap_Plasma = 5 , // a.k.a. matplotlib "plasma" (qual=false, n=11)
ImPlotColormap_Hot = 6 , // a.k.a. matplotlib/MATLAB "hot" (qual=false, n=11)
ImPlotColormap_Cool = 7 , // a.k.a. matplotlib/MATLAB "cool" (qual=false, n=11)
ImPlotColormap_Pink = 8 , // a.k.a. matplotlib/MATLAB "pink" (qual=false, n=11)
ImPlotColormap_Jet = 9 , // a.k.a. MATLAB "jet" (qual=false, n=11)
ImPlotColormap_Twilight = 10 , // a.k.a. matplotlib "twilight" (qual=false, n=11)
ImPlotColormap_RdBu = 11 , // red/blue, Color Brewer (qual=false, n=11)
ImPlotColormap_BrBG = 12 , // brown/blue-green, Color Brewer (qual=false, n=11)
ImPlotColormap_PiYG = 13 , // pink/yellow-green, Color Brewer (qual=false, n=11)
ImPlotColormap_Spectral = 14 , // color spectrum, Color Brewer (qual=false, n=11)
ImPlotColormap_Greys = 15 , // white/black (qual=false, n=2 )
2020-06-01 23:14:22 -04:00
} ;
2020-10-19 00:26:34 -04:00
// Used to position items on a plot (e.g. legends, labels, etc.)
enum ImPlotLocation_ {
ImPlotLocation_Center = 0 , // center-center
ImPlotLocation_North = 1 < < 0 , // top-center
ImPlotLocation_South = 1 < < 1 , // bottom-center
ImPlotLocation_West = 1 < < 2 , // center-left
ImPlotLocation_East = 1 < < 3 , // center-right
ImPlotLocation_NorthWest = ImPlotLocation_North | ImPlotLocation_West , // top-left
ImPlotLocation_NorthEast = ImPlotLocation_North | ImPlotLocation_East , // top-right
ImPlotLocation_SouthWest = ImPlotLocation_South | ImPlotLocation_West , // bottom-left
ImPlotLocation_SouthEast = ImPlotLocation_South | ImPlotLocation_East // bottom-right
} ;
// Used to orient items on a plot (e.g. legends, labels, etc.)
enum ImPlotOrientation_ {
ImPlotOrientation_Horizontal , // left/right
ImPlotOrientation_Vertical // up/down
} ;
// Enums for different y-axes.
enum ImPlotYAxis_ {
ImPlotYAxis_1 = 0 , // left (default)
ImPlotYAxis_2 = 1 , // first on right side
ImPlotYAxis_3 = 2 // second on right side
} ;
2021-03-17 08:38:45 -04:00
// Enums for different automatic histogram binning methods (k = bin count or w = bin width)
enum ImPlotBin_ {
ImPlotBin_Sqrt = - 1 , // k = sqrt(n)
ImPlotBin_Sturges = - 2 , // k = 1 + log2(n)
ImPlotBin_Rice = - 3 , // k = 2 * cbrt(n)
ImPlotBin_Scott = - 4 , // w = 3.49 * sigma / cbrt(n)
} ;
2020-06-01 23:14:22 -04:00
// Double precision version of ImVec2 used by ImPlot. Extensible by end users.
2020-05-16 22:09:36 -04:00
struct ImPlotPoint {
2020-05-29 13:39:30 -04:00
double x , y ;
2020-09-07 21:59:43 -04:00
ImPlotPoint ( ) { x = y = 0.0 ; }
2020-08-16 16:38:51 -04:00
ImPlotPoint ( double _x , double _y ) { x = _x ; y = _y ; }
2020-09-17 21:34:37 -04:00
ImPlotPoint ( const ImVec2 & p ) { x = p . x ; y = p . y ; }
2020-05-29 13:39:30 -04:00
double operator [ ] ( size_t idx ) const { return ( & x ) [ idx ] ; }
double & operator [ ] ( size_t idx ) { return ( & x ) [ idx ] ; }
# ifdef IMPLOT_POINT_CLASS_EXTRA
2020-08-24 12:48:00 -04:00
IMPLOT_POINT_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h
// to convert back and forth between your math types and ImPlotPoint.
2020-05-29 13:39:30 -04:00
# endif
2020-05-16 22:09:36 -04:00
} ;
2020-05-11 07:13:08 -04:00
// A range defined by a min/max value. Used for plot axes ranges.
2020-04-28 00:57:49 -04:00
struct ImPlotRange {
2020-05-29 13:39:30 -04:00
double Min , Max ;
2020-09-07 21:59:43 -04:00
ImPlotRange ( ) { Min = 0 ; Max = 0 ; }
2020-08-19 01:04:05 -04:00
ImPlotRange ( double _min , double _max ) { Min = _min ; Max = _max ; }
bool Contains ( double value ) const { return value > = Min & & value < = Max ; } ;
double Size ( ) const { return Max - Min ; } ;
2020-05-11 07:13:08 -04:00
} ;
// Combination of two ranges for X and Y axes.
struct ImPlotLimits {
ImPlotRange X , Y ;
2021-03-17 08:38:45 -04:00
ImPlotLimits ( ) { }
ImPlotLimits ( 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 ; }
bool Contains ( const ImPlotPoint & p ) const { return Contains ( p . x , p . y ) ; }
bool Contains ( double x , double y ) const { return X . Contains ( x ) & & Y . Contains ( y ) ; }
ImPlotPoint Min ( ) const { return ImPlotPoint ( X . Min , Y . Min ) ; }
ImPlotPoint Max ( ) const { return ImPlotPoint ( X . Max , Y . Max ) ; }
2020-04-28 00:57:49 -04:00
} ;
2020-04-27 11:27:59 -04:00
// Plot style structure
struct ImPlotStyle {
2020-08-24 00:45:42 -04:00
// item styling variables
2020-09-06 02:48:47 -04:00
float LineWeight ; // = 1, item line weight in pixels
int Marker ; // = ImPlotMarker_None, marker specification
float MarkerSize ; // = 4, marker size in pixels (roughly the marker's "radius")
float MarkerWeight ; // = 1, outline weight of markers in pixels
float FillAlpha ; // = 1, alpha modifier applied to plot fills
float ErrorBarSize ; // = 5, error bar whisker width in pixels
float ErrorBarWeight ; // = 1.5, error bar whisker weight in pixels
float DigitalBitHeight ; // = 8, digital channels bit height (at y = 1.0f) in pixels
float DigitalBitGap ; // = 4, digital channels bit padding gap in pixels
2020-08-24 00:45:42 -04:00
// plot styling variables
2020-09-06 02:48:47 -04:00
float PlotBorderSize ; // = 1, line thickness of border around plot area
float MinorAlpha ; // = 0.25 alpha multiplier applied to minor axis grid lines
ImVec2 MajorTickLen ; // = 10,10 major tick lengths for X and Y axes
ImVec2 MinorTickLen ; // = 5,5 minor tick lengths for X and Y axes
ImVec2 MajorTickSize ; // = 1,1 line thickness of major ticks
ImVec2 MinorTickSize ; // = 1,1 line thickness of minor ticks
ImVec2 MajorGridSize ; // = 1,1 line thickness of major grid lines
ImVec2 MinorGridSize ; // = 1,1 line thickness of minor grid lines
2020-10-19 00:26:34 -04:00
ImVec2 PlotPadding ; // = 10,10 padding between widget frame and plot area, labels, or outside legends (i.e. main padding)
2020-09-06 02:48:47 -04:00
ImVec2 LabelPadding ; // = 5,5 padding between axes labels, tick labels, and plot edge
2020-10-19 00:26:34 -04:00
ImVec2 LegendPadding ; // = 10,10 legend padding from plot edges
ImVec2 LegendInnerPadding ; // = 5,5 legend inner padding from legend edges
2021-03-17 08:38:45 -04:00
ImVec2 LegendSpacing ; // = 5,0 spacing between legend entries
2020-10-19 00:26:34 -04:00
ImVec2 MousePosPadding ; // = 10,10 padding between plot edge and interior mouse location text
2020-09-19 21:54:19 -04:00
ImVec2 AnnotationPadding ; // = 2,2 text padding around annotation labels
2020-12-04 00:27:38 -05:00
ImVec2 FitPadding ; // = 0,0 additional fit padding as a percentage of the fit extents (e.g. ImVec2(0.1f,0.1f) adds 10% to the fit extents of X and Y)
2020-10-19 00:26:34 -04:00
ImVec2 PlotDefaultSize ; // = 400,300 default size used when ImVec2(0,0) is passed to BeginPlot
2020-09-06 02:48:47 -04:00
ImVec2 PlotMinSize ; // = 300,225 minimum size plot frame can be when shrunk
2021-03-17 08:38:45 -04:00
// style colors
ImVec4 Colors [ ImPlotCol_COUNT ] ; // Array of styling colors. Indexable with ImPlotCol_ enums.
// colormap
ImPlotColormap Colormap ; // The current colormap. Set this to either an ImPlotColormap_ enum or an index returned by AddColormap.
2020-09-06 15:48:16 -04:00
// settings/flags
bool AntiAliasedLines ; // = false, enable global anti-aliasing on plot lines (overrides ImPlotFlags_AntiAliased)
bool UseLocalTime ; // = false, axis labels will be formatted for your timezone when ImPlotAxisFlag_Time is enabled
2020-10-14 23:07:27 -04:00
bool UseISO8601 ; // = false, dates will be formatted according to ISO 8601 where applicable (e.g. YYYY-MM-DD, YYYY-MM, --MM-DD, etc.)
2020-10-19 00:26:34 -04:00
bool Use24HourClock ; // = false, times will be formatted using a 24 hour clock
2020-09-07 21:59:43 -04:00
IMPLOT_API ImPlotStyle ( ) ;
2020-04-27 11:27:59 -04:00
} ;
//-----------------------------------------------------------------------------
2020-08-16 16:38:51 -04:00
// ImPlot End-User API
2020-04-27 11:27:59 -04:00
//-----------------------------------------------------------------------------
2020-05-12 05:19:34 -04:00
namespace ImPlot {
2020-04-27 11:27:59 -04:00
2020-08-16 11:25:06 -04:00
//-----------------------------------------------------------------------------
// ImPlot Context
//-----------------------------------------------------------------------------
// Creates a new ImPlot context. Call this after ImGui::CreateContext.
2020-09-07 21:59:43 -04:00
IMPLOT_API ImPlotContext * CreateContext ( ) ;
2021-03-17 08:38:45 -04:00
// Destroys an ImPlot context. Call this before ImGui::DestroyContext. NULL = destroy current context.
2020-09-07 21:59:43 -04:00
IMPLOT_API void DestroyContext ( ImPlotContext * ctx = NULL ) ;
// Returns the current ImPlot context. NULL if no context has ben set.
IMPLOT_API ImPlotContext * GetCurrentContext ( ) ;
// Sets the current ImPlot context.
IMPLOT_API void SetCurrentContext ( ImPlotContext * ctx ) ;
2020-08-16 11:25:06 -04:00
2021-03-17 08:38:45 -04:00
// Sets the current **ImGui** context. This is ONLY necessary if you are compiling
// ImPlot as a DLL (not recommended) separate from your ImGui compilation. It
// sets the global variable GImGui, which is not shared across DLL boundaries.
// See GImGui documentation in imgui.cpp for more details.
IMPLOT_API void SetImGuiContext ( ImGuiContext * ctx ) ;
2020-08-16 11:25:06 -04:00
//-----------------------------------------------------------------------------
// Begin/End Plot
//-----------------------------------------------------------------------------
2020-04-27 11:27:59 -04:00
// Starts a 2D plotting context. If this function returns true, EndPlot() must
2021-03-17 08:38:45 -04:00
// be called! You are encouraged to use the following call convention:
//
// if (BeginPlot(...)) {
// ImPlot::PlotLine(...);
// EndPlot();
// }
//
// Important notes:
//
// - #title_id must be unique to the current ImGui window. If you need to avoid ID
// collisions or don't want to display a title in the plot, use double hashes
// (e.g. "MyPlot##Hidden" or "##NoTitle").
// - If #x_label and/or #y_label are provided, axes labels will be displayed.
// - #size is the **frame** size of the plot widget, not the plot area. The default
// size of plots (i.e. when ImVec2(0,0)) can be modified in your ImPlotStyle
// (default is 400x300).
// - Auxiliary y-axes must be enabled with ImPlotFlags_YAxis2/3 to be displayed.
// - See ImPlotFlags and ImPlotAxisFlags for more available options.
2020-09-07 21:59:43 -04:00
IMPLOT_API bool BeginPlot ( const char * title_id ,
const char * x_label = NULL ,
const char * y_label = NULL ,
const ImVec2 & size = ImVec2 ( - 1 , 0 ) ,
ImPlotFlags flags = ImPlotFlags_None ,
ImPlotAxisFlags x_flags = ImPlotAxisFlags_None ,
ImPlotAxisFlags y_flags = ImPlotAxisFlags_None ,
ImPlotAxisFlags y2_flags = ImPlotAxisFlags_NoGridLines ,
2021-01-06 10:34:03 -05:00
ImPlotAxisFlags y3_flags = ImPlotAxisFlags_NoGridLines ,
const char * y2_label = NULL ,
const char * y3_label = NULL ) ;
2020-08-23 00:26:49 -04:00
2020-04-27 11:27:59 -04:00
// Only call EndPlot() if BeginPlot() returns true! Typically called at the end
2021-03-17 08:38:45 -04:00
// of an if statement conditioned on BeginPlot(). See above.
2020-09-07 21:59:43 -04:00
IMPLOT_API void EndPlot ( ) ;
2020-04-27 11:27:59 -04:00
//-----------------------------------------------------------------------------
2020-07-28 23:22:37 -04:00
// Plot Items
2020-04-27 11:27:59 -04:00
//-----------------------------------------------------------------------------
2020-09-07 21:59:43 -04:00
// The template functions below are explicitly instantiated in implot_items.cpp.
// They are not intended to be used generically with custom types. You will get
2020-09-07 17:08:59 -04:00
// a linker error if you try! All functions support the following scalar types:
//
2020-09-07 01:16:47 -04:00
// float, double, ImS8, ImU8, ImS16, ImU16, ImS32, ImU32, ImS64, ImU64
2020-09-07 17:08:59 -04:00
//
//
// If you need to plot custom or non-homogenous data you have a few options:
//
// 1. If your data is a simple struct/class (e.g. Vector2f), you can use striding.
// This is the most performant option if applicable.
//
2020-09-07 21:59:43 -04:00
// struct Vector2f { float X, Y; };
2020-09-07 17:08:59 -04:00
// ...
2020-09-07 21:59:43 -04:00
// Vector2f data[42];
2020-09-07 17:08:59 -04:00
// ImPlot::PlotLine("line", &data[0].x, &data[0].y, 42, 0, sizeof(Vector2f)); // or sizeof(float)*2
2020-09-07 21:59:43 -04:00
//
2021-03-17 08:38:45 -04:00
// 2. Write a custom getter C function or C++ lambda and pass it and your data to
2020-09-07 21:59:43 -04:00
// an ImPlot function post-fixed with a G (e.g. PlotScatterG). This has a
2021-03-17 08:38:45 -04:00
// slight performance cost, but probably not enough to worry about. Example:
2020-09-07 17:08:59 -04:00
//
// ImPlotPoint MyDataGetter(void* data, int idx) {
2020-09-07 21:59:43 -04:00
// MyData* my_data = (MyData*)data;
2020-09-07 17:08:59 -04:00
// ImPlotPoint p;
2020-09-07 21:59:43 -04:00
// p.x = my_data->GetTime(idx);
// p.y = my_data->GetValue(idx);
2020-09-07 17:08:59 -04:00
// return p
// }
// ...
2021-03-17 08:38:45 -04:00
// auto my_lambda = [](void*, int idx) {
// double t = idx / 999.0;
// return ImPlotPoint(t, 0.5+0.5*std::sin(2*PI*10*t));
// };
// ...
// if (ImPlot::BeginPlot("MyPlot")) {
// MyData my_data;
// ImPlot::PlotScatterG("scatter", MyDataGetter, &my_data, my_data.Size());
// ImPlot::PlotLineG("line", my_lambda, nullptr, 1000);
// ImPlot::EndPlot();
// }
2020-09-07 21:59:43 -04:00
//
2020-12-04 01:07:50 -05:00
// NB: All types are converted to double before plotting. You may lose information
2020-09-07 17:08:59 -04:00
// if you try plotting extremely large 64-bit integral types. Proceed with caution!
2020-09-06 23:34:58 -04:00
2020-09-07 01:16:47 -04:00
// Plots a standard 2D line plot.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotLine ( const char * label_id , const T * values , int count , double xscale = 1 , double x0 = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotLine ( const char * label_id , const T * xs , const T * ys , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
IMPLOT_API void PlotLineG ( const char * label_id , ImPlotPoint ( * getter ) ( void * data , int idx ) , void * data , int count , int offset = 0 ) ;
2020-05-31 10:17:07 -04:00
2020-08-23 00:26:49 -04:00
// Plots a standard 2D scatter plot. Default marker is ImPlotMarker_Circle.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotScatter ( const char * label_id , const T * values , int count , double xscale = 1 , double x0 = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotScatter ( const char * label_id , const T * xs , const T * ys , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
IMPLOT_API void PlotScatterG ( const char * label_id , ImPlotPoint ( * getter ) ( void * data , int idx ) , void * data , int count , int offset = 0 ) ;
2020-05-31 10:17:07 -04:00
2020-10-19 11:00:03 -04:00
// Plots a a stairstep graph. The y value is continued constantly from every x position, i.e. the interval [x[i], x[i+1]) has the value y[i].
template < typename T > IMPLOT_API void PlotStairs ( const char * label_id , const T * values , int count , double xscale = 1 , double x0 = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotStairs ( const char * label_id , const T * xs , const T * ys , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
IMPLOT_API void PlotStairsG ( const char * label_id , ImPlotPoint ( * getter ) ( void * data , int idx ) , void * data , int count , int offset = 0 ) ;
2021-01-11 14:22:52 -05:00
// Plots a shaded (filled) region between two lines, or a line and a horizontal reference. Set y_ref to +/-INFINITY for infinite fill extents.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotShaded ( const char * label_id , const T * values , int count , double y_ref = 0 , double xscale = 1 , double x0 = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotShaded ( const char * label_id , const T * xs , const T * ys , int count , double y_ref = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotShaded ( const char * label_id , const T * xs , const T * ys1 , const T * ys2 , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
IMPLOT_API void PlotShadedG ( const char * label_id , ImPlotPoint ( * getter1 ) ( void * data , int idx ) , void * data1 , ImPlotPoint ( * getter2 ) ( void * data , int idx ) , void * data2 , int count , int offset = 0 ) ;
2020-06-13 13:42:47 -04:00
2020-08-17 19:31:30 -04:00
// Plots a vertical bar graph. #width and #shift are in X units.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotBars ( const char * label_id , const T * values , int count , double width = 0.67 , double shift = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotBars ( const char * label_id , const T * xs , const T * ys , int count , double width , int offset = 0 , int stride = sizeof ( T ) ) ;
IMPLOT_API void PlotBarsG ( const char * label_id , ImPlotPoint ( * getter ) ( void * data , int idx ) , void * data , int count , double width , int offset = 0 ) ;
2020-05-31 10:17:07 -04:00
2020-08-23 00:26:49 -04:00
// Plots a horizontal bar graph. #height and #shift are in Y units.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotBarsH ( const char * label_id , const T * values , int count , double height = 0.67 , double shift = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotBarsH ( const char * label_id , const T * xs , const T * ys , int count , double height , int offset = 0 , int stride = sizeof ( T ) ) ;
IMPLOT_API void PlotBarsHG ( const char * label_id , ImPlotPoint ( * getter ) ( void * data , int idx ) , void * data , int count , double height , int offset = 0 ) ;
2020-05-31 10:17:07 -04:00
2020-08-17 19:31:30 -04:00
// Plots vertical error bar. The label_id should be the same as the label_id of the associated line or bar plot.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotErrorBars ( const char * label_id , const T * xs , const T * ys , const T * err , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotErrorBars ( const char * label_id , const T * xs , const T * ys , const T * neg , const T * pos , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
2020-05-31 10:17:07 -04:00
2020-08-17 19:31:30 -04:00
// Plots horizontal error bars. The label_id should be the same as the label_id of the associated line or bar plot.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotErrorBarsH ( const char * label_id , const T * xs , const T * ys , const T * err , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotErrorBarsH ( const char * label_id , const T * xs , const T * ys , const T * neg , const T * pos , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
2020-06-07 18:39:25 -04:00
2020-09-02 10:17:18 -04:00
/// Plots vertical stems.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotStems ( const char * label_id , const T * values , int count , double y_ref = 0 , double xscale = 1 , double x0 = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotStems ( const char * label_id , const T * xs , const T * ys , int count , double y_ref = 0 , int offset = 0 , int stride = sizeof ( T ) ) ;
2020-09-02 10:17:18 -04:00
2021-01-15 02:52:37 -05:00
/// Plots infinite vertical or horizontal lines (e.g. for references or asymptotes).
template < typename T > IMPLOT_API void PlotVLines ( const char * label_id , const T * xs , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
template < typename T > IMPLOT_API void PlotHLines ( const char * label_id , const T * ys , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
2020-08-23 00:26:49 -04:00
// Plots a pie chart. If the sum of values > 1 or normalize is true, each value will be normalized. Center and radius are in plot units. #label_fmt can be set to NULL for no labels.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotPieChart ( const char * const label_ids [ ] , const T * values , int count , double x , double y , double radius , bool normalize = false , const char * label_fmt = " %.1f " , double angle0 = 90 ) ;
2020-05-31 10:17:07 -04:00
2021-03-20 00:43:03 -04:00
// Plots a 2D heatmap chart. Values are expected to be in row-major order. Leave #scale_min and scale_max both at 0 for automatic color scaling, or set them to a predefined range. #label_fmt can be set to NULL for no labels.
template < typename T > IMPLOT_API 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 ) ) ;
2020-06-01 18:33:01 -04:00
2021-03-17 08:38:45 -04:00
// Plots a horizontal histogram. #bins can be a positive integer or an ImPlotBin_ method. If #cumulative is true, each bin contains its count plus the counts of all previous bins.
// If #density is true, the PDF is visualized. If both are true, the CDF is visualized. If #range is left unspecified, the min/max of #values will be used as the range.
// If #range is specified, outlier values outside of the range are not binned. However, outliers still count toward normalizing and cumulative counts unless #outliers is false. The largest bin count or density is returned.
template < typename T > IMPLOT_API double PlotHistogram ( const char * label_id , const T * values , int count , int bins = ImPlotBin_Sturges , bool cumulative = false , bool density = false , ImPlotRange range = ImPlotRange ( ) , bool outliers = true , double bar_scale = 1.0 ) ;
// Plots two dimensional, bivariate histogram as a heatmap. #x_bins and #y_bins can be a positive integer or an ImPlotBin. If #density is true, the PDF is visualized.
// If #range is left unspecified, the min/max of #xs an #ys will be used as the ranges. If #range is specified, outlier values outside of range are not binned.
// However, outliers still count toward the normalizing count for density plots unless #outliers is false. The largest bin count or density is returned.
template < typename T > IMPLOT_API double PlotHistogram2D ( const char * label_id , const T * xs , const T * ys , int count , int x_bins = ImPlotBin_Sturges , int y_bins = ImPlotBin_Sturges , bool density = false , ImPlotLimits range = ImPlotLimits ( ) , bool outliers = true ) ;
2020-08-23 00:26:49 -04:00
// Plots digital data. Digital plots do not respond to y drag or zoom, and are always referenced to the bottom of the plot.
2020-09-10 00:29:29 -04:00
template < typename T > IMPLOT_API void PlotDigital ( const char * label_id , const T * xs , const T * ys , int count , int offset = 0 , int stride = sizeof ( T ) ) ;
IMPLOT_API void PlotDigitalG ( const char * label_id , ImPlotPoint ( * getter ) ( void * data , int idx ) , void * data , int count , int offset = 0 ) ;
2020-05-31 10:17:07 -04:00
2020-09-17 21:34:37 -04:00
// Plots an axis-aligned image. #bounds_min/bounds_max are in plot coordinatse (y-up) and #uv0/uv1 are in texture coordinates (y-down).
2020-09-17 21:40:16 -04:00
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 ) ) ;
2020-09-17 12:58:58 -04:00
2020-09-01 22:01:00 -04:00
// Plots a centered text label at point x,y with optional pixel offset. Text color can be changed with ImPlot::PushStyleColor(ImPlotCol_InlayText, ...).
2020-09-19 21:54:19 -04:00
IMPLOT_API void PlotText ( const char * text , double x , double y , bool vertical = false , const ImVec2 & pix_offset = ImVec2 ( 0 , 0 ) ) ;
2020-05-29 09:40:04 -04:00
2021-03-17 08:38:45 -04:00
// Plots a dummy item (i.e. adds a legend entry colored by ImPlotCol_Line)
2020-10-19 00:26:34 -04:00
IMPLOT_API void PlotDummy ( const char * label_id ) ;
2020-08-23 00:26:49 -04:00
//-----------------------------------------------------------------------------
// Plot Utils
//-----------------------------------------------------------------------------
2021-01-18 22:49:23 -05:00
// The following functions MUST be called BEFORE BeginPlot!
2020-09-18 09:22:06 -04:00
2020-08-23 00:26:49 -04:00
// Set the axes range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the axes limits will be locked.
2020-09-07 21:59:43 -04:00
IMPLOT_API void SetNextPlotLimits ( double xmin , double xmax , double ymin , double ymax , ImGuiCond cond = ImGuiCond_Once ) ;
2020-08-23 00:26:49 -04:00
// Set the X axis range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the X axis limits will be locked.
2020-09-07 21:59:43 -04:00
IMPLOT_API void SetNextPlotLimitsX ( double xmin , double xmax , ImGuiCond cond = ImGuiCond_Once ) ;
2020-08-23 00:26:49 -04:00
// Set the Y axis range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the Y axis limits will be locked.
2020-10-19 00:26:34 -04:00
IMPLOT_API void SetNextPlotLimitsY ( double ymin , double ymax , ImGuiCond cond = ImGuiCond_Once , ImPlotYAxis y_axis = 0 ) ;
2020-09-06 17:09:00 -04:00
// Links the next plot limits to external values. Set to NULL for no linkage. The pointer data must remain valid until the matching call EndPlot.
2020-09-07 21:59:43 -04:00
IMPLOT_API void LinkNextPlotLimits ( double * xmin , double * xmax , double * ymin , double * ymax , double * ymin2 = NULL , double * ymax2 = NULL , double * ymin3 = NULL , double * ymax3 = NULL ) ;
2020-08-23 00:26:49 -04:00
// Fits the next plot axes to all plotted data if they are unlocked (equivalent to double-clicks).
2020-09-07 21:59:43 -04:00
IMPLOT_API void FitNextPlotAxes ( bool x = true , bool y = true , bool y2 = true , bool y3 = true ) ;
2020-08-23 00:26:49 -04:00
// Set the X axis ticks and optionally the labels for the next plot.
2020-09-07 21:59:43 -04:00
IMPLOT_API void SetNextPlotTicksX ( const double * values , int n_ticks , const char * const labels [ ] = NULL , bool show_default = false ) ;
IMPLOT_API void SetNextPlotTicksX ( double x_min , double x_max , int n_ticks , const char * const labels [ ] = NULL , bool show_default = false ) ;
2020-08-23 00:26:49 -04:00
// Set the Y axis ticks and optionally the labels for the next plot.
2020-10-19 00:26:34 -04:00
IMPLOT_API void SetNextPlotTicksY ( const double * values , int n_ticks , const char * const labels [ ] = NULL , bool show_default = false , ImPlotYAxis y_axis = 0 ) ;
IMPLOT_API void SetNextPlotTicksY ( double y_min , double y_max , int n_ticks , const char * const labels [ ] = NULL , bool show_default = false , ImPlotYAxis y_axis = 0 ) ;
2020-08-23 00:26:49 -04:00
2021-01-18 22:49:23 -05:00
// The following functions MUST be called BETWEEN Begin/EndPlot!
2020-09-18 09:22:06 -04:00
2020-10-19 00:26:34 -04:00
// Select which Y axis will be used for subsequent plot elements. The default is ImPlotYAxis_1, or the first (left) Y axis. Enable 2nd and 3rd axes with ImPlotFlags_YAxisX.
IMPLOT_API void SetPlotYAxis ( ImPlotYAxis y_axis ) ;
// Hides or shows the next plot item (i.e. as if it were toggled from the legend). Use ImGuiCond_Always if you need to forcefully set this every frame.
2020-09-18 09:22:06 -04:00
IMPLOT_API void HideNextItem ( bool hidden = true , ImGuiCond cond = ImGuiCond_Once ) ;
2020-08-24 00:45:42 -04:00
2020-10-19 00:26:34 -04:00
// Convert pixels to a position in the current plot's coordinate system. A negative y_axis uses the current value of SetPlotYAxis (ImPlotYAxis_1 initially).
IMPLOT_API ImPlotPoint PixelsToPlot ( const ImVec2 & pix , ImPlotYAxis y_axis = IMPLOT_AUTO ) ;
IMPLOT_API ImPlotPoint PixelsToPlot ( float x , float y , ImPlotYAxis y_axis = IMPLOT_AUTO ) ;
// Convert a position in the current plot's coordinate system to pixels. A negative y_axis uses the current value of SetPlotYAxis (ImPlotYAxis_1 initially).
IMPLOT_API ImVec2 PlotToPixels ( const ImPlotPoint & plt , ImPlotYAxis y_axis = IMPLOT_AUTO ) ;
IMPLOT_API ImVec2 PlotToPixels ( double x , double y , ImPlotYAxis y_axis = IMPLOT_AUTO ) ;
2020-08-23 00:26:49 -04:00
// Get the current Plot position (top-left) in pixels.
2020-09-07 21:59:43 -04:00
IMPLOT_API ImVec2 GetPlotPos ( ) ;
2020-08-23 00:26:49 -04:00
// Get the curent Plot size in pixels.
2020-09-07 21:59:43 -04:00
IMPLOT_API ImVec2 GetPlotSize ( ) ;
2020-07-26 22:28:22 -04:00
// Returns true if the plot area in the current plot is hovered.
2020-09-07 21:59:43 -04:00
IMPLOT_API bool IsPlotHovered ( ) ;
2020-07-26 22:28:22 -04:00
// Returns true if the XAxis plot area in the current plot is hovered.
2020-09-07 21:59:43 -04:00
IMPLOT_API bool IsPlotXAxisHovered ( ) ;
2020-07-26 22:28:22 -04:00
// Returns true if the YAxis[n] plot area in the current plot is hovered.
2020-10-19 00:26:34 -04:00
IMPLOT_API bool IsPlotYAxisHovered ( ImPlotYAxis y_axis = 0 ) ;
// Returns the mouse position in x,y coordinates of the current plot. A negative y_axis uses the current value of SetPlotYAxis (ImPlotYAxis_1 initially).
IMPLOT_API ImPlotPoint GetPlotMousePos ( ImPlotYAxis y_axis = IMPLOT_AUTO ) ;
// Returns the current plot axis range. A negative y_axis uses the current value of SetPlotYAxis (ImPlotYAxis_1 initially).
IMPLOT_API ImPlotLimits GetPlotLimits ( ImPlotYAxis y_axis = IMPLOT_AUTO ) ;
2020-09-18 09:22:06 -04:00
2020-09-19 21:54:19 -04:00
// Returns true if the current plot is being queried. Query must be enabled with ImPlotFlags_Query.
IMPLOT_API bool IsPlotQueried ( ) ;
// Returns the current plot query bounds. Query must be enabled with ImPlotFlags_Query.
2020-10-19 00:26:34 -04:00
IMPLOT_API ImPlotLimits GetPlotQuery ( ImPlotYAxis y_axis = IMPLOT_AUTO ) ;
2020-09-19 21:54:19 -04:00
2020-09-18 09:22:06 -04:00
//-----------------------------------------------------------------------------
// Plot Tools
//-----------------------------------------------------------------------------
2021-01-18 22:49:23 -05:00
// The following functions MUST be called BETWEEN Begin/EndPlot!
2020-10-19 00:26:34 -04:00
2020-10-11 01:38:18 -04:00
// Shows an annotation callout at a chosen point.
2020-10-12 10:51:22 -04:00
IMPLOT_API void Annotate ( double x , double y , const ImVec2 & pix_offset , const char * fmt , . . . ) IM_FMTARGS ( 4 ) ;
IMPLOT_API void Annotate ( double x , double y , const ImVec2 & pix_offset , const ImVec4 & color , const char * fmt , . . . ) IM_FMTARGS ( 5 ) ;
2020-10-11 03:53:28 -04:00
IMPLOT_API void AnnotateV ( double x , double y , const ImVec2 & pix_offset , const char * fmt , va_list args ) IM_FMTLIST ( 4 ) ;
IMPLOT_API void AnnotateV ( double x , double y , const ImVec2 & pix_offset , const ImVec4 & color , const char * fmt , va_list args ) IM_FMTLIST ( 5 ) ;
2020-10-12 10:51:22 -04:00
2020-10-11 03:53:28 -04:00
// Same as above, but the annotation will always be clamped to stay inside the plot area.
2020-10-12 10:51:22 -04:00
IMPLOT_API void AnnotateClamped ( double x , double y , const ImVec2 & pix_offset , const char * fmt , . . . ) IM_FMTARGS ( 4 ) ;
IMPLOT_API void AnnotateClamped ( double x , double y , const ImVec2 & pix_offset , const ImVec4 & color , const char * fmt , . . . ) IM_FMTARGS ( 5 ) ;
2020-10-11 03:53:28 -04:00
IMPLOT_API void AnnotateClampedV ( double x , double y , const ImVec2 & pix_offset , const char * fmt , va_list args ) IM_FMTLIST ( 4 ) ;
IMPLOT_API void AnnotateClampedV ( double x , double y , const ImVec2 & pix_offset , const ImVec4 & color , const char * fmt , va_list args ) IM_FMTLIST ( 5 ) ;
2020-09-19 13:33:33 -04:00
// Shows a draggable vertical guide line at an x-value. #col defaults to ImGuiCol_Text.
IMPLOT_API bool DragLineX ( const char * id , double * x_value , bool show_label = true , const ImVec4 & col = IMPLOT_AUTO_COL , float thickness = 1 ) ;
// Shows a draggable horizontal guide line at a y-value. #col defaults to ImGuiCol_Text.
IMPLOT_API bool DragLineY ( const char * id , double * y_value , bool show_label = true , const ImVec4 & col = IMPLOT_AUTO_COL , float thickness = 1 ) ;
// Shows a draggable point at x,y. #col defaults to ImGuiCol_Text.
IMPLOT_API bool DragPoint ( const char * id , double * x , double * y , bool show_label = true , const ImVec4 & col = IMPLOT_AUTO_COL , float radius = 4 ) ;
2020-09-18 14:37:55 -04:00
2020-09-18 09:22:06 -04:00
//-----------------------------------------------------------------------------
// Legend Utils and Tools
//-----------------------------------------------------------------------------
2021-02-28 19:10:23 -05:00
// The following functions MUST be called BETWEEN Begin/EndPlot!
2020-10-19 00:26:34 -04:00
2021-03-17 08:38:45 -04:00
// Set the location of the current plot's legend (default = North|West).
2020-10-19 00:26:34 -04:00
IMPLOT_API void SetLegendLocation ( ImPlotLocation location , ImPlotOrientation orientation = ImPlotOrientation_Vertical , bool outside = false ) ;
2020-10-19 11:00:03 -04:00
// Set the location of the current plot's mouse position text (default = South|East).
2020-10-19 00:26:34 -04:00
IMPLOT_API void SetMousePosLocation ( ImPlotLocation location ) ;
2020-09-18 09:22:06 -04:00
// Returns true if a plot item legend entry is hovered.
IMPLOT_API bool IsLegendEntryHovered ( const char * label_id ) ;
2021-02-28 19:10:23 -05:00
2020-09-18 09:22:06 -04:00
// Begin a popup for a legend entry.
IMPLOT_API bool BeginLegendPopup ( const char * label_id , ImGuiMouseButton mouse_button = 1 ) ;
// End a popup for a legend entry.
IMPLOT_API void EndLegendPopup ( ) ;
2021-02-28 19:10:23 -05:00
//-----------------------------------------------------------------------------
// Drag and Drop Utils
//-----------------------------------------------------------------------------
// The following functions MUST be called BETWEEN Begin/EndPlot!
// Turns the current plot's plotting area into a drag and drop target. Don't forget to call EndDragDropTarget!
IMPLOT_API bool BeginDragDropTarget ( ) ;
// Turns the current plot's X-axis into a drag and drop target. Don't forget to call EndDragDropTarget!
IMPLOT_API bool BeginDragDropTargetX ( ) ;
// Turns the current plot's Y-Axis into a drag and drop target. Don't forget to call EndDragDropTarget!
IMPLOT_API bool BeginDragDropTargetY ( ImPlotYAxis axis = ImPlotYAxis_1 ) ;
// Turns the current plot's legend into a drag and drop target. Don't forget to call EndDragDropTarget!
IMPLOT_API bool BeginDragDropTargetLegend ( ) ;
// Ends a drag and drop target (currently just an alias for ImGui::EndDragDropTarget).
IMPLOT_API void EndDragDropTarget ( ) ;
// NB: By default, plot and axes drag and drop sources require holding the Ctrl modifier to initiate the drag.
// You can change the modifier if desired. If ImGuiKeyModFlags_None is provided, the axes will be locked from panning.
// Turns the current plot's plotting area into a drag and drop source. Don't forget to call EndDragDropSource!
IMPLOT_API bool BeginDragDropSource ( ImGuiKeyModFlags key_mods = ImGuiKeyModFlags_Ctrl , ImGuiDragDropFlags flags = 0 ) ;
// Turns the current plot's X-axis into a drag and drop source. Don't forget to call EndDragDropSource!
IMPLOT_API bool BeginDragDropSourceX ( ImGuiKeyModFlags key_mods = ImGuiKeyModFlags_Ctrl , ImGuiDragDropFlags flags = 0 ) ;
// Turns the current plot's Y-axis into a drag and drop source. Don't forget to call EndDragDropSource!
IMPLOT_API bool BeginDragDropSourceY ( ImPlotYAxis axis = ImPlotYAxis_1 , ImGuiKeyModFlags key_mods = ImGuiKeyModFlags_Ctrl , ImGuiDragDropFlags flags = 0 ) ;
// Turns an item in the current plot's legend into drag and drop source. Don't forget to call EndDragDropSource!
IMPLOT_API bool BeginDragDropSourceItem ( const char * label_id , ImGuiDragDropFlags flags = 0 ) ;
// Ends a drag and drop source (currently just an alias for ImGui::EndDragDropSource).
IMPLOT_API void EndDragDropSource ( ) ;
2020-06-15 11:48:22 -04:00
//-----------------------------------------------------------------------------
2020-09-01 00:23:48 -04:00
// Plot and Item Styling
2020-04-27 11:27:59 -04:00
//-----------------------------------------------------------------------------
2021-03-17 08:38:45 -04:00
// Styling colors in ImPlot works similarly to styling colors in ImGui, but
// with one important difference. Like ImGui, all style colors are stored in an
// indexable array in ImPlotStyle. You can permanently modify these values through
// GetStyle().Colors, or temporarily modify them with Push/Pop functions below.
// However, by default all style colors in ImPlot default to a special color
// IMPLOT_AUTO_COL. The behavior of this color depends upon the style color to
// which it as applied:
//
// 1) For style colors associated with plot items (e.g. ImPlotCol_Line),
// IMPLOT_AUTO_COL tells ImPlot to color the item with the next unused
// color in the current colormap. Thus, every item will have a different
// color up to the number of colors in the colormap, at which point the
// colormap will roll over. For most use cases, you should not need to
// modify these style colors to anything but IMPLOT_COL_AUTO. You are
// probably better off changing the current colormap. However, if you
// need to explicitly color a particular item you may either Push/Pop
// the style color around the item in question, or use the SetNextXXXStyle
// API below. If you permanently set one of these style colors to a specific
// color, or forget to call Pop, then all subsequent items will be styled
// with the color you set.
//
// 2) For style colors associated with plot styling (e.g. ImPlotCol_PlotBg),
// IMPLOT_AUTO_COL tells ImPlot to set that color from color data in your
// **ImGuiStyle**. The ImGuiCol_ that these style colors default to are
// detailed above, and in general have been mapped to produce plots visually
// consistent with your current ImGui style. Of course, you are free to
// manually set these colors to whatever you like, and further can Push/Pop
// them around individual plots.
2020-04-27 11:27:59 -04:00
// Provides access to plot style structure for permanant modifications to colors, sizes, etc.
2020-09-07 21:59:43 -04:00
IMPLOT_API ImPlotStyle & GetStyle ( ) ;
2020-04-27 11:27:59 -04:00
2021-03-17 08:38:45 -04:00
// Style plot colors for current ImGui style (default).
2020-09-07 21:59:43 -04:00
IMPLOT_API void StyleColorsAuto ( ImPlotStyle * dst = NULL ) ;
2021-03-17 08:38:45 -04:00
// Style plot colors for ImGui "Classic".
2020-09-07 21:59:43 -04:00
IMPLOT_API void StyleColorsClassic ( ImPlotStyle * dst = NULL ) ;
2021-03-17 08:38:45 -04:00
// Style plot colors for ImGui "Dark".
2020-09-07 21:59:43 -04:00
IMPLOT_API void StyleColorsDark ( ImPlotStyle * dst = NULL ) ;
2021-03-17 08:38:45 -04:00
// Style plot colors for ImGui "Light".
2020-09-07 21:59:43 -04:00
IMPLOT_API void StyleColorsLight ( ImPlotStyle * dst = NULL ) ;
2020-08-24 12:06:29 -04:00
2020-09-01 00:23:48 -04:00
// Use PushStyleX to temporarily modify your ImPlotStyle. The modification
// will last until the matching call to PopStyleX. You MUST call a pop for
// every push, otherwise you will leak memory! This behaves just like ImGui.
2020-08-30 18:12:36 -04:00
2021-03-17 08:38:45 -04:00
// Temporarily modify a style color. Don't forget to call PopStyleColor!
2020-09-07 21:59:43 -04:00
IMPLOT_API void PushStyleColor ( ImPlotCol idx , ImU32 col ) ;
IMPLOT_API void PushStyleColor ( ImPlotCol idx , const ImVec4 & col ) ;
2021-03-17 08:38:45 -04:00
// Undo temporary style color modification(s). Undo multiple pushes at once by increasing count.
2020-09-07 21:59:43 -04:00
IMPLOT_API void PopStyleColor ( int count = 1 ) ;
2020-04-27 11:27:59 -04:00
2020-05-31 10:28:34 -04:00
// Temporarily modify a style variable of float type. Don't forget to call PopStyleVar!
2020-09-07 21:59:43 -04:00
IMPLOT_API void PushStyleVar ( ImPlotStyleVar idx , float val ) ;
2020-05-31 10:28:34 -04:00
// Temporarily modify a style variable of int type. Don't forget to call PopStyleVar!
2020-09-07 21:59:43 -04:00
IMPLOT_API void PushStyleVar ( ImPlotStyleVar idx , int val ) ;
2020-08-21 00:01:21 -04:00
// Temporarily modify a style variable of ImVec2 type. Don't forget to call PopStyleVar!
2020-09-07 21:59:43 -04:00
IMPLOT_API void PushStyleVar ( ImPlotStyleVar idx , const ImVec2 & val ) ;
2021-03-17 08:38:45 -04:00
// Undo temporary style variable modification(s). Undo multiple pushes at once by increasing count.
2020-09-07 21:59:43 -04:00
IMPLOT_API void PopStyleVar ( int count = 1 ) ;
2020-04-27 11:27:59 -04:00
2020-09-01 00:23:48 -04:00
// The following can be used to modify the style of the next plot item ONLY. They do
// NOT require calls to PopStyleX. Leave style attributes you don't want modified to
// IMPLOT_AUTO or IMPLOT_AUTO_COL. Automatic styles will be deduced from the current
2020-09-06 22:20:38 -04:00
// values in your ImPlotStyle or from Colormap data.
2020-09-01 00:23:48 -04:00
// Set the line color and weight for the next item only.
2020-09-07 21:59:43 -04:00
IMPLOT_API void SetNextLineStyle ( const ImVec4 & col = IMPLOT_AUTO_COL , float weight = IMPLOT_AUTO ) ;
2020-09-01 00:23:48 -04:00
// Set the fill color for the next item only.
2020-09-07 21:59:43 -04:00
IMPLOT_API void SetNextFillStyle ( const ImVec4 & col = IMPLOT_AUTO_COL , float alpha_mod = IMPLOT_AUTO ) ;
2020-09-01 00:23:48 -04:00
// Set the marker style for the next item only.
2020-09-07 21:59:43 -04:00
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 ) ;
2020-09-01 00:23:48 -04:00
// Set the error bar style for the next item only.
2020-09-07 21:59:43 -04:00
IMPLOT_API void SetNextErrorBarStyle ( const ImVec4 & col = IMPLOT_AUTO_COL , float size = IMPLOT_AUTO , float weight = IMPLOT_AUTO ) ;
2020-09-01 00:23:48 -04:00
2020-09-19 21:54:19 -04:00
// Gets the last item primary color (i.e. its legend icon color)
IMPLOT_API ImVec4 GetLastItemColor ( ) ;
2020-09-01 00:23:48 -04:00
// Returns the null terminated string name for an ImPlotCol.
2020-09-19 21:54:19 -04:00
IMPLOT_API const char * GetStyleColorName ( ImPlotCol idx ) ;
2020-09-02 16:55:35 -04:00
// Returns the null terminated string name for an ImPlotMarker.
2020-09-19 21:54:19 -04:00
IMPLOT_API const char * GetMarkerName ( ImPlotMarker idx ) ;
2020-09-01 00:23:48 -04:00
//-----------------------------------------------------------------------------
// Colormaps
//-----------------------------------------------------------------------------
2021-03-17 08:38:45 -04:00
// Item styling is based on colormaps when the relevant ImPlotCol_XXX is set to
// IMPLOT_AUTO_COL (default). Several built-in colormaps are available. You can
// add and then push/pop your own colormaps as well. To permanently set a colormap,
// modify the Colormap index member of your ImPlotStyle.
2020-09-01 00:23:48 -04:00
2021-03-17 08:38:45 -04:00
// Colormap data will be ignored and a custom color will be used if you have done one of the following:
2021-01-18 22:49:23 -05:00
// 1) Modified an item style color in your ImPlotStyle to anything other than IMPLOT_AUTO_COL.
2020-09-01 00:23:48 -04:00
// 2) Pushed an item style color using PushStyleColor().
2021-03-17 08:38:45 -04:00
// 3) Set the next item style with a SetNextXXXStyle function.
// Add a new colormap. The colormap can be used by pushing either the returned index or the string name with PushColormap.
// The colormap name must be unique and the size must be greater than 1. You will receive an assert otherwise! By default
// colormaps are considered to be qualitative (i.e. discrete). If you want to create a continuous colormap, set #qual=false.
// This will treat the colors you provide as keys, and ImPlot will build a linearly interpolated lookup table that fills
// in the gaps. The memory footprint of this table will be exactly ((size-1)*255+1)*4 bytes.
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 ) ;
// Returns the number of available colormaps.
IMPLOT_API int GetColormapCount ( ) ;
// Returns a null terminated string name for a colormap given an index. Returns NULL if index is invalid.
IMPLOT_API const char * GetColormapName ( ImPlotColormap cmap ) ;
// Returns an index number for a colormap given a valid string name. Returns -1 if name is invalid.
IMPLOT_API ImPlotColormap GetColormapIndex ( const char * name ) ;
// Temporarily switch to one of the built-in (i.e. ImPlotColormap_XXX) or user-added colormaps (i.e. a return value of AddColormap). Don't forget to call PopColormap!
IMPLOT_API void PushColormap ( ImPlotColormap cmap ) ;
// Push a colormap by string name. Use built-in names such as "Default", "Deep", "Jet", etc or a string you provided to AddColormap. Don't forget to call PopColormap!
IMPLOT_API void PushColormap ( const char * name ) ;
// Undo temporary colormap modification(s). Undo multiple pushes at once by increasing count.
2020-09-07 21:59:43 -04:00
IMPLOT_API void PopColormap ( int count = 1 ) ;
2020-09-01 22:01:00 -04:00
2021-03-17 08:38:45 -04:00
// Returns the next color from the current colormap and advances the colormap for the current plot.
// Can also be used with no return value to skip colors if desired. You need to call this between Begin/EndPlot!
2020-09-07 21:59:43 -04:00
IMPLOT_API ImVec4 NextColormapColor ( ) ;
2020-09-01 22:01:00 -04:00
2021-03-17 08:38:45 -04:00
// Colormap utils. If cmap = IMPLOT_AUTO (default), the current colormap is assumed.
// Pass an explicit colormap index (built-in or user added) to specify otherwise.
// Returns the size of a colormap.
IMPLOT_API int GetColormapSize ( ImPlotColormap cmap = IMPLOT_AUTO ) ;
// Returns a color from a colormap given an index >= 0 (modulo will be performed).
IMPLOT_API ImVec4 GetColormapColor ( int idx , ImPlotColormap cmap = IMPLOT_AUTO ) ;
// Sample a color from the current colormap given t between 0 and 1.
IMPLOT_API ImVec4 SampleColormap ( float t , ImPlotColormap cmap = IMPLOT_AUTO ) ;
// Shows a vertical color scale with linear spaced ticks using the specified color map. Use double hashes to hide label (e.g. "##NoLabel").
IMPLOT_API void ColormapScale ( const char * label , double scale_min , double scale_max , const ImVec2 & size = ImVec2 ( 0 , 0 ) , ImPlotColormap cmap = IMPLOT_AUTO ) ;
// Shows a horizontal slider with a colormap gradient background. Optionally returns the color sampled at t in [0 1].
IMPLOT_API bool ColormapSlider ( const char * label , float * t , ImVec4 * out = NULL , const char * format = " " , ImPlotColormap cmap = IMPLOT_AUTO ) ;
// Shows a button with a colormap gradient brackground.
IMPLOT_API bool ColormapButton ( const char * label , const ImVec2 & size = ImVec2 ( 0 , 0 ) , ImPlotColormap cmap = IMPLOT_AUTO ) ;
// When items in a plot sample their color from a colormap, the color is cached and does not change
// unless explicitly overriden. Therefore, if you change the colormap after the item has already been plotted,
// item colors will not update. If you need item colors to resample the new colormap, then use this
// function to bust the cached colors. If #plot_title_id is NULL, then every item in EVERY existing plot
// will be cache busted. Otherwise only the plot specified by #plot_title_id will be busted. For the
// latter, this function must be called in the ImGui window that the plot is in. You should rarely if ever
// need this function, but it is available for applications that require runtime swaps (see Heatmaps demo).
IMPLOT_API void BustColorCache ( const char * plot_title_id = NULL ) ;
2020-08-23 00:26:49 -04:00
2020-04-30 09:46:18 -04:00
//-----------------------------------------------------------------------------
2020-08-23 00:26:49 -04:00
// Miscellaneous
2020-04-30 09:46:18 -04:00
//-----------------------------------------------------------------------------
2021-03-17 08:38:45 -04:00
// Render icons similar to those that appear in legends (nifty for data lists).
2021-02-28 19:10:23 -05:00
IMPLOT_API void ItemIcon ( const ImVec4 & col ) ;
IMPLOT_API void ItemIcon ( ImU32 col ) ;
2021-03-17 08:38:45 -04:00
IMPLOT_API void ColormapIcon ( ImPlotColormap cmap ) ;
2021-02-28 19:10:23 -05:00
2021-03-17 08:38:45 -04:00
// Get the plot draw list for custom rendering to the current plot area. Call between Begin/EndPlot.
2020-09-07 21:59:43 -04:00
IMPLOT_API ImDrawList * GetPlotDrawList ( ) ;
2021-03-17 08:38:45 -04:00
// Push clip rect for rendering to current plot area. Call between Begin/EndPlot.
2020-09-07 21:59:43 -04:00
IMPLOT_API void PushPlotClipRect ( ) ;
2021-03-17 08:38:45 -04:00
// Pop plot clip rect. Call between Begin/EndPlot.
2020-09-07 21:59:43 -04:00
IMPLOT_API void PopPlotClipRect ( ) ;
2020-04-30 09:46:18 -04:00
2020-09-01 22:01:00 -04:00
// Shows ImPlot style selector dropdown menu.
2020-09-07 21:59:43 -04:00
IMPLOT_API bool ShowStyleSelector ( const char * label ) ;
2020-10-11 01:38:18 -04:00
// Shows ImPlot colormap selector dropdown menu.
IMPLOT_API bool ShowColormapSelector ( const char * label ) ;
2020-09-01 22:01:00 -04:00
// Shows ImPlot style editor block (not a window).
2020-09-07 21:59:43 -04:00
IMPLOT_API void ShowStyleEditor ( ImPlotStyle * ref = NULL ) ;
2021-03-17 08:38:45 -04:00
// Add basic help/info block for end users (not a window).
2020-09-07 21:59:43 -04:00
IMPLOT_API void ShowUserGuide ( ) ;
2020-10-21 11:08:41 -04:00
// Shows ImPlot metrics/debug information.
IMPLOT_API void ShowMetricsWindow ( bool * p_popen = NULL ) ;
2020-09-07 21:59:43 -04:00
2020-04-27 11:27:59 -04:00
//-----------------------------------------------------------------------------
2020-08-24 00:45:42 -04:00
// Demo (add implot_demo.cpp to your sources!)
2020-04-27 11:27:59 -04:00
//-----------------------------------------------------------------------------
2020-12-04 01:07:50 -05:00
// Shows the ImPlot demo.
2020-09-07 21:59:43 -04:00
IMPLOT_API void ShowDemoWindow ( bool * p_open = NULL ) ;
2020-04-27 11:27:59 -04:00
2020-05-12 05:19:34 -04:00
} // namespace ImPlot