ImPlot’s internal API (implot_internal.h): the structures and helpers that ImPlot is built with.
The C++ API of ImPlot: the signatures and the documentation of its headers. This page is generated by litgen, the engine behind the Python bindings of Dear ImGui Bundle. Functions without Python bindings are not listed.
implot_internal.h¶
Generic Helpers¶
Computes the common (base-10) logarithm¶
ImPlot::ImLog10¶
static inline float ImLog10(float x);(private API)
ImPlot::ImSinh¶
static inline float ImSinh(float x);(private API)
ImPlot::ImAsinh¶
static inline float ImAsinh(float x);(private API)
ImPlot::ImPosMod¶
static inline int ImPosMod(int l, int r);Returns always positive modulo (assumes r != 0) (private API)
ImPlot::ImNan¶
static inline bool ImNan(double val);Returns True if val is NAN (private API)
ImPlot::ImNanOrInf¶
static inline bool ImNanOrInf(double val);Returns True if val is NAN or INFINITY (private API)
ImPlot::ImConstrainNan¶
static inline double ImConstrainNan(double val);Turns NANs to 0s (private API)
ImPlot::ImConstrainInf¶
static inline double ImConstrainInf(double val);Turns infinity to floating point maximums (private API)
ImPlot::ImConstrainLog¶
static inline double ImConstrainLog(double val);Turns numbers less than or equal to 0 to 0.001 (sort of arbitrary, is there a better way?) (private API)
ImPlot::ImConstrainTime¶
static inline double ImConstrainTime(double val);Turns numbers less than 0 to zero (private API)
ImPlot::ImAlmostEqual¶
static inline bool ImAlmostEqual(double v1, double v2, int ulp = 2);True if two numbers are approximately equal using units in the last place. (private API)
ImPlot::ImMixU32¶
static inline ImU32 ImMixU32(ImU32 a, ImU32 b, ImU32 s);Mix color a and b by factor s in [0 256] (private API)
ImPlot::ImAlphaU32¶
static inline ImU32 ImAlphaU32(ImU32 col, float alpha);Set alpha channel of 32-bit color from float in range [0.0 1.0] (private API)
ImPlotTimeUnit_ (enum)¶
enum ImPlotTimeUnit_| Member | Value | |
|---|---|---|
ImPlotTimeUnit_Us | 0 | microsecond |
ImPlotTimeUnit_Ms | 1 | millisecond |
ImPlotTimeUnit_S | 2 | second |
ImPlotTimeUnit_Min | 3 | minute |
ImPlotTimeUnit_Hr | 4 | hour |
ImPlotTimeUnit_Day | 5 | day |
ImPlotTimeUnit_Mo | 6 | month |
ImPlotTimeUnit_Yr | 7 | year |
ImPlotTimeUnit_COUNT | 8 |
ImPlotDateFmt_ (enum)¶
enum ImPlotDateFmt_| Member | Value | |
|---|---|---|
ImPlotDateFmt_None = 0 | 0 | |
ImPlotDateFmt_DayMo | 1 | 10/3 [ --10-03 ] |
ImPlotDateFmt_DayMoYr | 2 | 10/3/91 [ 1991-10-03 ] |
ImPlotDateFmt_MoYr | 3 | Oct 1991 [ 1991-10 ] |
ImPlotDateFmt_Mo | 4 | Oct [ --10 ] |
ImPlotDateFmt_Yr | 5 | 1991 [ 1991 ] |
ImPlotTimeFmt_ (enum)¶
enum ImPlotTimeFmt_| Member | Value | |
|---|---|---|
ImPlotTimeFmt_None = 0 | 0 | |
ImPlotTimeFmt_Us | 1 | .428 552 [ .428 552 ] |
ImPlotTimeFmt_SUs | 2 | :29.428 552 [ :29.428 552 ] |
ImPlotTimeFmt_SMs | 3 | :29.428 [ :29.428 ] |
ImPlotTimeFmt_S | 4 | :29 [ :29 ] |
ImPlotTimeFmt_MinSMs | 5 | 21:29.428 [ 21:29.428 ] |
ImPlotTimeFmt_HrMinSMs | 6 | 7:21:29.428pm [ 19:21:29.428 ] |
ImPlotTimeFmt_HrMinS | 7 | 7:21:29pm [ 19:21:29 ] |
ImPlotTimeFmt_HrMin | 8 | 7:21pm [ 19:21 ] |
ImPlotTimeFmt_Hr | 9 | 7pm [ 19:00 ] |
ImPlotMarkerInternal_ (enum)¶
enum ImPlotMarkerInternal_| Member | Value | |
|---|---|---|
ImPlotMarker_Invalid = -3 | -3 |
Structs¶
ImPlotDateTimeSpec (struct)¶
struct ImPlotDateTimeSpecCombined date/time format spec
| Member | |
|---|---|
ImPlotDateFmt Date; | |
ImPlotTimeFmt Time; | |
bool UseISO8601; | |
bool Use24HourClock; |
ImPlotDateTimeSpec::ImPlotDateTimeSpec¶
ImPlotDateTimeSpec();ImPlotDateTimeSpec(ImPlotDateFmt date_fmt, ImPlotTimeFmt time_fmt, bool use_24_hr_clk = false, bool use_iso_8601 = false);ImPlotTime (struct)¶
struct ImPlotTimeTwo part timestamp struct.
| Member | |
|---|---|
time_t S; | second part |
int Us; | microsecond part |
ImPlotTime::ImPlotTime¶
ImPlotTime();ImPlotTime(time_t s, int us = 0);ImPlotTime::RollOver¶
void RollOver();(private API)
ImPlotTime::ToDouble¶
double ToDouble() const;(private API)
ImPlotTime::FromDouble¶
static ImPlotTime FromDouble(double t);(private API)
ImPlotColormapData (struct)¶
struct ImPlotColormapDataColormap data storage
| Member | |
|---|---|
ImVector<ImU32> Keys; | |
ImVector<int> KeyCounts; | |
ImVector<int> KeyOffsets; | |
ImVector<ImU32> Tables; | |
ImVector<int> TableSizes; | |
ImVector<int> TableOffsets; | |
ImGuiTextBuffer Text; | |
ImVector<int> TextOffsets; | |
ImGuiStorage Map; | |
int Count; |
ImPlotColormapData::ImPlotColormapData¶
ImPlotColormapData();ImPlotColormapData::Append¶
int Append(const char* name, const ImU32* keys, int count, bool qual);(private API)
ImPlotColormapData::RebuildTables¶
void RebuildTables();(private API)
ImPlotColormapData::IsQual¶
inline bool IsQual(ImPlotColormap cmap) const;(private API)
ImPlotColormapData::GetName¶
inline const char* GetName(ImPlotColormap cmap) const;(private API)
ImPlotColormapData::GetIndex¶
inline ImPlotColormap GetIndex(const char* name) const;(private API)
ImPlotColormapData::GetKeys¶
inline const ImU32* GetKeys(ImPlotColormap cmap) const;(private API)
ImPlotColormapData::GetKeyCount¶
inline int GetKeyCount(ImPlotColormap cmap) const;(private API)
ImPlotColormapData::GetKeyColor¶
inline ImU32 GetKeyColor(ImPlotColormap cmap, int idx) const;(private API)
ImPlotColormapData::SetKeyColor¶
inline void SetKeyColor(ImPlotColormap cmap, int idx, ImU32 value);(private API)
ImPlotColormapData::GetTable¶
inline const ImU32* GetTable(ImPlotColormap cmap) const;(private API)
ImPlotColormapData::GetTableSize¶
inline int GetTableSize(ImPlotColormap cmap) const;(private API)
ImPlotColormapData::GetTableColor¶
inline ImU32 GetTableColor(ImPlotColormap cmap, int idx) const;(private API)
ImPlotColormapData::LerpTable¶
inline ImU32 LerpTable(ImPlotColormap cmap, float t) const;(private API)
ImPlotPointError (struct)¶
struct ImPlotPointErrorImPlotPoint with positive/negative error values
| Member | |
|---|---|
double X, | |
Y, | |
Neg, | |
Pos; |
ImPlotPointError::ImPlotPointError¶
ImPlotPointError();ImPlotPointError(double x, double y, double neg, double pos);ImPlotAnnotation (struct)¶
struct ImPlotAnnotationInterior plot label/annotation
| Member | |
|---|---|
ImVec2 Pos; | |
ImVec2 Offset; | |
ImU32 ColorBg; | |
ImU32 ColorFg; | |
int TextOffset; | |
bool Clamp; |
ImPlotAnnotation::ImPlotAnnotation¶
ImPlotAnnotation();ImPlotAnnotationCollection (struct)¶
struct ImPlotAnnotationCollectionCollection of plot labels
| Member | |
|---|---|
ImGuiTextBuffer TextBuffer; | |
int Size; |
ImPlotAnnotationCollection::ImPlotAnnotationCollection¶
ImPlotAnnotationCollection();ImPlotAnnotationCollection::Append¶
void Append(const ImVec2& pos, const ImVec2& off, ImU32 bg, ImU32 fg, bool clamp, const char* fmt, ...);(private API)
ImPlotAnnotationCollection::GetText¶
const char* GetText(int idx);(private API)
ImPlotAnnotationCollection::Reset¶
void Reset();(private API)
ImPlotTag (struct)¶
struct ImPlotTag| Member | |
|---|---|
ImAxis Axis; | |
double Value; | |
ImU32 ColorBg; | |
ImU32 ColorFg; | |
int TextOffset; |
ImPlotTag::ImPlotTag¶
ImPlotTag();ImPlotTagCollection (struct)¶
struct ImPlotTagCollection| Member | |
|---|---|
ImGuiTextBuffer TextBuffer; | |
int Size; |
ImPlotTagCollection::ImPlotTagCollection¶
ImPlotTagCollection();ImPlotTagCollection::Append¶
void Append(ImAxis axis, double value, ImU32 bg, ImU32 fg, const char* fmt, ...);(private API)
ImPlotTagCollection::GetText¶
const char* GetText(int idx);(private API)
ImPlotTagCollection::Reset¶
void Reset();(private API)
ImPlotTick (struct)¶
struct ImPlotTickTick mark info
| Member | |
|---|---|
double PlotPos; | |
float PixelPos; | |
ImVec2 LabelSize; | |
int TextOffset; | |
bool Major; | |
bool ShowLabel; | |
int Level; | |
int Idx; |
ImPlotTick::ImPlotTick¶
ImPlotTick();ImPlotTick(double value, bool major, int level, bool show_label);ImPlotTicker (struct)¶
struct ImPlotTickerCollection of ticks
| Member | |
|---|---|
ImGuiTextBuffer TextBuffer; | |
ImVec2 MaxSize; | |
ImVec2 LateSize; | |
int Levels; |
ImPlotTicker::ImPlotTicker¶
ImPlotTicker();ImPlotTicker::AddTick¶
ImPlotTick& AddTick(double value, bool major, int level, bool show_label, const char* label);inline ImPlotTick& AddTick(ImPlotTick tick);(private API)
ImPlotTicker::GetText¶
const char* GetText(int idx) const;const char* GetText(const ImPlotTick& tick);(private API)
ImPlotTicker::OverrideSizeLate¶
void OverrideSizeLate(const ImVec2& size);(private API)
ImPlotTicker::Reset¶
void Reset();(private API)
ImPlotTicker::TickCount¶
int TickCount() const;(private API)
ImPlotAxis (struct)¶
struct ImPlotAxisAxis state information that must persist after EndPlot
| Member | |
|---|---|
ImGuiID ID; | |
ImPlotAxisFlags Flags; | |
ImPlotAxisFlags PreviousFlags; | |
ImPlotRange Range; | |
ImPlotCond RangeCond; | |
ImPlotScale Scale; | |
ImPlotRange FitExtents; | |
ImPlotAxis* OrthoAxis; | |
ImPlotRange ConstraintRange; | |
ImPlotRange ConstraintZoom; | |
ImPlotTicker Ticker; | |
void* FormatterData; | |
double* LinkedMin; | |
double* LinkedMax; | |
int PickerLevel; | |
ImPlotTime PickerTimeMin, | |
PickerTimeMax; | |
void* TransformData; | |
float PixelMin, | |
PixelMax; | |
double ScaleMin, | |
ScaleMax; | |
double ScaleToPixel; | |
float Datum1, | |
Datum2; | |
ImRect HoverRect; | |
int LabelOffset; | |
ImU32 ColorMaj, | |
ColorMin, | |
ColorTick, | |
ColorTxt, | |
ColorBg, | |
ColorHov, | |
ColorAct, | |
ColorHiLi; | |
bool Enabled; | |
bool Vertical; | |
bool FitThisFrame; | |
bool HasRange; | |
bool HasFormatSpec; | |
bool ShowDefaultTicks; | |
bool Hovered; | |
bool Held; |
ImPlotAxis::ImPlotAxis¶
ImPlotAxis();ImPlotAxis::Reset¶
inline void Reset();(private API)
ImPlotAxis::SetMin¶
inline bool SetMin(double _min, bool force=false);(private API)
ImPlotAxis::SetMax¶
inline bool SetMax(double _max, bool force=false);(private API)
ImPlotAxis::SetRange¶
inline void SetRange(double v1, double v2);inline void SetRange(const ImPlotRange& range);(private API)
ImPlotAxis::SetAspect¶
inline void SetAspect(double unit_per_pix);(private API)
ImPlotAxis::PixelSize¶
inline float PixelSize() const;(private API)
ImPlotAxis::GetAspect¶
inline double GetAspect() const;(private API)
ImPlotAxis::Constrain¶
inline void Constrain();(private API)
ImPlotAxis::UpdateTransformCache¶
inline void UpdateTransformCache();(private API)
ImPlotAxis::PlotToPixels¶
inline float PlotToPixels(double plt) const;(private API)
ImPlotAxis::PixelsToPlot¶
inline double PixelsToPlot(float pix) const;(private API)
ImPlotAxis::ExtendFit¶
inline void ExtendFit(double v);(private API)
ImPlotAxis::ExtendFitWith¶
inline void ExtendFitWith(ImPlotAxis& alt, double v, double v_alt);(private API)
ImPlotAxis::ApplyFit¶
inline void ApplyFit(float padding);(private API)
ImPlotAxis::HasLabel¶
inline bool HasLabel() const;(private API)
ImPlotAxis::HasGridLines¶
inline bool HasGridLines() const;(private API)
ImPlotAxis::HasTickLabels¶
inline bool HasTickLabels() const;(private API)
ImPlotAxis::HasTickMarks¶
inline bool HasTickMarks() const;(private API)
ImPlotAxis::WillRender¶
inline bool WillRender() const;(private API)
ImPlotAxis::IsOpposite¶
inline bool IsOpposite() const;(private API)
ImPlotAxis::IsInverted¶
inline bool IsInverted() const;(private API)
ImPlotAxis::IsForeground¶
inline bool IsForeground() const;(private API)
ImPlotAxis::IsAutoFitting¶
inline bool IsAutoFitting() const;(private API)
ImPlotAxis::CanInitFit¶
inline bool CanInitFit() const;(private API)
ImPlotAxis::IsRangeLocked¶
inline bool IsRangeLocked() const;(private API)
ImPlotAxis::IsLockedMin¶
inline bool IsLockedMin() const;(private API)
ImPlotAxis::IsLockedMax¶
inline bool IsLockedMax() const;(private API)
ImPlotAxis::IsLocked¶
inline bool IsLocked() const;(private API)
ImPlotAxis::IsInputLockedMin¶
inline bool IsInputLockedMin() const;(private API)
ImPlotAxis::IsInputLockedMax¶
inline bool IsInputLockedMax() const;(private API)
ImPlotAxis::IsInputLocked¶
inline bool IsInputLocked() const;(private API)
ImPlotAxis::HasMenus¶
inline bool HasMenus() const;(private API)
ImPlotAxis::IsPanLocked¶
inline bool IsPanLocked(bool increasing);(private API)
ImPlotAxis::PushLinks¶
void PushLinks();(private API)
ImPlotAxis::PullLinks¶
void PullLinks();(private API)
ImPlotAlignmentData (struct)¶
struct ImPlotAlignmentDataAlign plots group data
| Member | |
|---|---|
bool Vertical; | |
float PadA; | |
float PadB; | |
float PadAMax; | |
float PadBMax; |
ImPlotAlignmentData::ImPlotAlignmentData¶
ImPlotAlignmentData();ImPlotAlignmentData::Begin¶
void Begin();(private API)
ImPlotAlignmentData::Update¶
void Update(float& pad_a, float& pad_b, float& delta_a, float& delta_b);(private API)
ImPlotAlignmentData::End¶
void End();(private API)
ImPlotAlignmentData::Reset¶
void Reset();(private API)
ImPlotItem (struct)¶
struct ImPlotItemState information for Plot items
| Member | |
|---|---|
ImGuiID ID; | |
ImU32 Color; | |
ImPlotMarker Marker; | |
ImRect LegendHoverRect; | |
int NameOffset; | |
bool Show; | |
bool LegendHovered; | |
bool SeenThisFrame; |
ImPlotItem::ImPlotItem¶
ImPlotItem();ImPlotLegend (struct)¶
struct ImPlotLegendHolds Legend state
| Member | |
|---|---|
ImPlotLegendFlags Flags; | |
ImPlotLegendFlags PreviousFlags; | |
ImPlotLocation Location; | |
ImPlotLocation PreviousLocation; | |
ImVec2 Scroll; | |
ImVector<int> Indices; | |
ImGuiTextBuffer Labels; | |
ImRect Rect; | |
ImRect RectClamped; | |
bool Hovered; | |
bool Held; | |
bool CanGoInside; |
ImPlotLegend::ImPlotLegend¶
ImPlotLegend();ImPlotLegend::Reset¶
void Reset();(private API)
ImPlotItemGroup (struct)¶
struct ImPlotItemGroupHolds Items and Legend data
| Member | |
|---|---|
ImGuiID ID; | |
ImPlotLegend Legend; | |
int ColormapIdx; | |
ImPlotMarker MarkerIdx; |
ImPlotItemGroup::ImPlotItemGroup¶
ImPlotItemGroup();ImPlotItemGroup::GetItemCount¶
int GetItemCount() const;(private API)
ImPlotItemGroup::GetItemID¶
ImGuiID GetItemID(const char* label_id);(private API)
ImPlotItemGroup::GetItem¶
ImPlotItem* GetItem(ImGuiID id);ImPlotItem* GetItem(const char* label_id);(private API)
ImPlotItemGroup::GetOrAddItem¶
ImPlotItem* GetOrAddItem(ImGuiID id);(private API)
ImPlotItemGroup::GetItemByIndex¶
ImPlotItem* GetItemByIndex(int i);(private API)
ImPlotItemGroup::GetItemIndex¶
int GetItemIndex(ImPlotItem* item);(private API)
ImPlotItemGroup::GetLegendCount¶
int GetLegendCount() const;(private API)
ImPlotItemGroup::GetLegendItem¶
ImPlotItem* GetLegendItem(int i);(private API)
ImPlotItemGroup::GetLegendLabel¶
const char* GetLegendLabel(int i);(private API)
ImPlotItemGroup::Reset¶
void Reset();(private API)
ImPlotPlot (struct)¶
struct ImPlotPlotHolds Plot state information that must persist after EndPlot
| Member | |
|---|---|
ImGuiID ID; | |
ImPlotFlags Flags; | |
ImPlotFlags PreviousFlags; | |
ImPlotLocation MouseTextLocation; | |
ImPlotMouseTextFlags MouseTextFlags; | |
ImGuiTextBuffer TextBuffer; | |
ImPlotItemGroup Items; | |
ImAxis CurrentX; | |
ImAxis CurrentY; | |
ImRect FrameRect; | |
ImRect CanvasRect; | |
ImRect PlotRect; | |
ImRect AxesRect; | |
ImRect SelectRect; | |
ImVec2 SelectStart; | |
int TitleOffset; | |
bool JustCreated; | |
bool Initialized; | |
bool SetupLocked; | |
bool FitThisFrame; | |
bool Hovered; | |
bool Held; | |
bool Selecting; | |
bool Selected; | |
bool ContextLocked; |
ImPlotPlot::ImPlotPlot¶
ImPlotPlot();ImPlotPlot::IsInputLocked¶
inline bool IsInputLocked() const;(private API)
ImPlotPlot::ClearTextBuffer¶
inline void ClearTextBuffer();(private API)
ImPlotPlot::SetTitle¶
inline void SetTitle(const char* title);(private API)
ImPlotPlot::HasTitle¶
inline bool HasTitle() const;(private API)
ImPlotPlot::GetTitle¶
inline const char* GetTitle() const;(private API)
ImPlotPlot::XAxis¶
inline ImPlotAxis& XAxis(int i);(private API)
ImPlotPlot::YAxis¶
inline ImPlotAxis& YAxis(int i);(private API)
ImPlotPlot::EnabledAxesX¶
inline int EnabledAxesX();(private API)
ImPlotPlot::EnabledAxesY¶
inline int EnabledAxesY();(private API)
ImPlotPlot::SetAxisLabel¶
inline void SetAxisLabel(ImPlotAxis& axis, const char* label);(private API)
ImPlotPlot::GetAxisLabel¶
inline const char* GetAxisLabel(const ImPlotAxis& axis) const;(private API)
ImPlotSubplot (struct)¶
struct ImPlotSubplotHolds subplot data that must persist after EndSubplot
| Member | |
|---|---|
ImGuiID ID; | |
ImPlotSubplotFlags Flags; | |
ImPlotSubplotFlags PreviousFlags; | |
ImPlotItemGroup Items; | |
int Rows; | |
int Cols; | |
int CurrentIdx; | |
ImRect FrameRect; | |
ImRect GridRect; | |
ImVec2 CellSize; | |
ImVector<float> RowRatios; | |
ImVector<float> ColRatios; | |
float TempSizes[2]; | ndarray[type=float, size=2] |
bool FrameHovered; | |
bool HasTitle; |
ImPlotSubplot::ImPlotSubplot¶
ImPlotSubplot();ImPlotNextPlotData (struct)¶
struct ImPlotNextPlotDataTemporary data storage for upcoming plot
ImPlotNextPlotData::ImPlotNextPlotData¶
ImPlotNextPlotData();ImPlotNextPlotData::Reset¶
void Reset();(private API)
ImPlotNextItemData (struct)¶
struct ImPlotNextItemDataTemporary data storage for upcoming item
| Member | |
|---|---|
ImPlotSpec Spec; | |
bool RenderLine; | |
bool RenderFill; | |
bool RenderMarkerLine; | |
bool RenderMarkerFill; | |
bool RenderMarkers; | |
bool HasHidden; | |
bool Hidden; | |
ImPlotCond HiddenCond; |
ImPlotNextItemData::ImPlotNextItemData¶
ImPlotNextItemData();ImPlotNextItemData::Reset¶
void Reset();(private API)
ImPlotContext (struct)¶
struct ImPlotContextHolds state information that must persist between calls to BeginPlot()/EndPlot()
| Member | |
|---|---|
ImPlotPlot* CurrentPlot; | |
ImPlotSubplot* CurrentSubplot; | |
ImPlotItemGroup* CurrentItems; | |
ImPlotItem* CurrentItem; | |
ImPlotItem* PreviousItem; | |
ImPlotTicker CTicker; | |
ImPlotAnnotationCollection Annotations; | |
ImPlotTagCollection Tags; | |
ImPlotStyle Style; | |
ImVector<ImGuiColorMod> ColorModifiers; | |
ImVector<ImGuiStyleMod> StyleModifiers; | |
ImPlotColormapData ColormapData; | |
ImVector<int> TempInt1; | |
int DigitalPlotItemCnt; | |
int DigitalPlotOffset; | |
ImPlotNextPlotData NextPlotData; | |
ImPlotNextItemData NextItemData; | |
ImPlotInputMap InputMap; | |
bool OpenContextThisFrame; | |
ImGuiTextBuffer MousePosStringBuilder; | |
ImPlotItemGroup* SortItems; | |
ImPlotAlignmentData* CurrentAlignmentH; | |
ImPlotAlignmentData* CurrentAlignmentV; | |
bool CanDragPlotInNodeEditor = false; |
Context Utils¶
ImPlot::Initialize¶
IMPLOT_API void Initialize(ImPlotContext* ctx);Initializes an ImPlotContext
ImPlot::ResetCtxForNextPlot¶
IMPLOT_API void ResetCtxForNextPlot(ImPlotContext* ctx);Resets an ImPlot context for the next call to BeginPlot
ImPlot::ResetCtxForNextAlignedPlots¶
IMPLOT_API void ResetCtxForNextAlignedPlots(ImPlotContext* ctx);Resets an ImPlot context for the next call to BeginAlignedPlots
ImPlot::ResetCtxForNextSubplot¶
IMPLOT_API void ResetCtxForNextSubplot(ImPlotContext* ctx);Resets an ImPlot context for the next call to BeginSubplot
Plot Utils¶
ImPlot::GetPlot¶
IMPLOT_API ImPlotPlot* GetPlot(const char* title);Gets a plot from the current ImPlotContext
ImPlot::GetCurrentPlot¶
IMPLOT_API ImPlotPlot* GetCurrentPlot();Gets the current plot from the current ImPlotContext
ImPlot::BustPlotCache¶
IMPLOT_API void BustPlotCache();Busts the cache for every plot in the current context
ImPlot::ShowPlotContextMenu¶
IMPLOT_API void ShowPlotContextMenu(ImPlotPlot& plot);Shows a plot’s context menu.
Setup Utils¶
ImPlot::SetupLock¶
static inline void SetupLock();Lock Setup and call SetupFinish if necessary. (private API)
Subplot Utils¶
ImPlot::SubplotNextCell¶
IMPLOT_API void SubplotNextCell();Advances to next subplot
ImPlot::ShowSubplotsContextMenu¶
IMPLOT_API void ShowSubplotsContextMenu(ImPlotSubplot& subplot);Shows a subplot’s context menu.
Item Utils¶
ImPlot::BeginItem¶
IMPLOT_API bool BeginItem(const char* label_id, const ImPlotSpec& spec = ImPlotSpec(), const ImVec4& item_col = IMPLOT_AUTO_COL, ImPlotMarker item_mkr = ImPlotMarker_Invalid);Begins a new item. Returns False if the item should not be plotted. Pushes PlotClipRect.
ImPlot::EndItem¶
IMPLOT_API void EndItem();Ends an item (call only if BeginItem returns True). Pops PlotClipRect.
ImPlot::RegisterOrGetItem¶
IMPLOT_API ImPlotItem* RegisterOrGetItem(const char* label_id, ImPlotItemFlags flags, bool* just_created = nullptr);Register or get an existing item from the current plot.
ImPlot::GetItem¶
IMPLOT_API ImPlotItem* GetItem(const char* label_id);Get a plot item from the current plot.
ImPlot::GetCurrentItem¶
IMPLOT_API ImPlotItem* GetCurrentItem();Gets the current item.
ImPlot::BustItemCache¶
IMPLOT_API void BustItemCache();Busts the cache for every item for every plot in the current context.
Axis Utils¶
ImPlot::AnyAxesInputLocked¶
static inline bool AnyAxesInputLocked(ImPlotAxis* axes, int count);Returns True if any enabled axis is locked from user input. (private API)
ImPlot::AllAxesInputLocked¶
static inline bool AllAxesInputLocked(ImPlotAxis* axes, int count);Returns True if all enabled axes are locked from user input. (private API)
ImPlot::AnyAxesHeld¶
static inline bool AnyAxesHeld(ImPlotAxis* axes, int count);(private API)
ImPlot::AnyAxesHovered¶
static inline bool AnyAxesHovered(ImPlotAxis* axes, int count);(private API)
ImPlot::FitThisFrame¶
static inline bool FitThisFrame();Returns True if the user has requested data to be fit. (private API)
ImPlot::FitPointX¶
static inline void FitPointX(double x);Extends the current plot’s axes so that it encompasses a vertical line at x (private API)
ImPlot::FitPointY¶
static inline void FitPointY(double y);Extends the current plot’s axes so that it encompasses a horizontal line at y (private API)
ImPlot::FitPoint¶
static inline void FitPoint(const ImPlotPoint& p);Extends the current plot’s axes so that it encompasses point p (private API)
ImPlot::RangesOverlap¶
static inline bool RangesOverlap(const ImPlotRange& r1, const ImPlotRange& r2);Returns True if two ranges overlap (private API)
ImPlot::ShowAxisContextMenu¶
IMPLOT_API void ShowAxisContextMenu(ImPlotAxis& axis, ImPlotAxis* equal_axis, bool time_allowed = false);Shows an axis’s context menu.
Legend Utils¶
ImPlot::GetLocationPos¶
IMPLOT_API ImVec2 GetLocationPos(const ImRect& outer_rect, const ImVec2& inner_size, ImPlotLocation location, const ImVec2& pad = ImVec2(0,0));Gets the position of an inner rect that is located inside of an outer rect according to an ImPlotLocation and padding amount.
ImPlot::CalcLegendSize¶
IMPLOT_API ImVec2 CalcLegendSize(ImPlotItemGroup& items, const ImVec2& pad, const ImVec2& spacing, bool vertical);Calculates the bounding box size of a legend before clipping.
ImPlot::ClampLegendRect¶
IMPLOT_API bool ClampLegendRect(ImRect& legend_rect, const ImRect& outer_rect, const ImVec2& pad);Clips calculated legend size
ImPlot::ShowLegendEntries¶
IMPLOT_API bool ShowLegendEntries(ImPlotItemGroup& items, const ImRect& legend_bb, bool interactable, const ImVec2& pad, const ImVec2& spacing, bool vertical, ImDrawList& DrawList);Renders legend entries into a bounding box
ImPlot::ShowAltLegend¶
IMPLOT_API void ShowAltLegend(const char* title_id, bool vertical = true, const ImVec2 size = ImVec2(0,0), bool interactable = true);Shows an alternate legend for the plot identified by #title_id, outside of the plot frame (can be called before or after of Begin/EndPlot but must occur in the same ImGui window! This is not thoroughly tested nor scrollable!).
ImPlot::ShowLegendContextMenu¶
IMPLOT_API bool ShowLegendContextMenu(ImPlotLegend& legend, bool visible);Shows a legend’s context menu.
Styling Utils¶
ImPlot::GetItemData¶
static inline const ImPlotNextItemData& GetItemData();Get styling data for next item (call between Begin/EndItem) (private API)
ImPlot::IsColorAuto¶
static inline bool IsColorAuto(const ImVec4& col);static inline bool IsColorAuto(ImPlotCol idx);Returns True if a color is set to be automatically determined (private API)
ImPlot::GetAutoColor¶
IMPLOT_API ImVec4 GetAutoColor(ImPlotCol idx);Returns the automatically deduced style color
ImPlot::GetStyleColorVec4¶
static inline ImVec4 GetStyleColorVec4(ImPlotCol idx);(private API)
Returns the style color whether it is automatic or custom set
ImPlot::GetStyleColorU32¶
static inline ImU32 GetStyleColorU32(ImPlotCol idx);(private API)
ImPlot::AddTextVertical¶
IMPLOT_API void AddTextVertical(ImDrawList *DrawList, ImVec2 pos, ImU32 col, const char* text_begin, const char* text_end = nullptr);Draws vertical text. The position is the bottom left of the text rect.
ImPlot::AddTextCentered¶
IMPLOT_API void AddTextCentered(ImDrawList* DrawList, ImVec2 top_center, ImU32 col, const char* text_begin, const char* text_end = nullptr);Draws multiline horizontal text centered.
ImPlot::CalcTextSizeVertical¶
static inline ImVec2 CalcTextSizeVertical(const char *text);Calculates the size of vertical text (private API)
Returns white or black text given background color¶
ImPlot::CalcTextColor¶
static inline ImU32 CalcTextColor(const ImVec4& bg);static inline ImU32 CalcTextColor(ImU32 bg);(private API)
ImPlot::CalcHoverColor¶
static inline ImU32 CalcHoverColor(ImU32 col);Lightens or darkens a color for hover (private API)
ImPlot::ClampLabelPos¶
static inline ImVec2 ClampLabelPos(ImVec2 pos, const ImVec2& size, const ImVec2& Min, const ImVec2& Max);Clamps a label position so that it fits a rect defined by Min/Max (private API)
ImPlot::GetColormapColorU32¶
IMPLOT_API ImU32 GetColormapColorU32(int idx, ImPlotColormap cmap);Returns a color from the Color map given an index >= 0 (modulo will be performed).
ImPlot::NextColormapColorU32¶
IMPLOT_API ImU32 NextColormapColorU32();Returns the next unused colormap color and advances the colormap. Can be used to skip colors if desired.
ImPlot::SampleColormapU32¶
IMPLOT_API ImU32 SampleColormapU32(float t, ImPlotColormap cmap);Linearly interpolates a color from the current colormap given t between 0 and 1.
Render Horizontal/Vertical lines¶
Math and Misc Utils
ImPlot::NiceNum¶
IMPLOT_API double NiceNum(double x, bool round);Rounds x to powers of 2,5 and 10 for generating axis labels (from Graphics Gems 1 Chapter 11.2)
ImPlot::OrderOfMagnitude¶
static inline int OrderOfMagnitude(double val);Computes order of magnitude of double. (private API)
ImPlot::OrderToPrecision¶
static inline int OrderToPrecision(int order);Returns the precision required for a order of magnitude. (private API)
ImPlot::Precision¶
static inline int Precision(double val);Returns a floating point precision to use given a value (private API)
ImPlot::RoundTo¶
static inline double RoundTo(double val, int prec);Round a value to a given precision (private API)
ImPlot::Intersection¶
static inline ImVec2 Intersection(const ImVec2& a1, const ImVec2& a2, const ImVec2& b1, const ImVec2& b2);Returns the intersection point of two lines A and B (assumes they are not parallel!) (private API)
Time Utils¶
ImPlot::IsLeapYear¶
static inline bool IsLeapYear(int year);Returns True if year is leap year (366 days long) (private API)
ImPlot::GetDaysInMonth¶
static inline int GetDaysInMonth(int year, int month);Returns the number of days in a month, accounting for Feb. leap years. #month is zero indexed. (private API)
ImPlot::MakeTime¶
IMPLOT_API ImPlotTime MakeTime(int year, int month = 0, int day = 1, int hour = 0, int min = 0, int sec = 0, int us = 0);Make a timestamp from time components. year[1970-3000], month[0-11], day[1-31], hour[0-23], min[0-59], sec[0-59], us[0,999999]
ImPlot::GetYear¶
IMPLOT_API int GetYear(const ImPlotTime& t);Get year component from timestamp [1970-3000]
ImPlot::GetMonth¶
IMPLOT_API int GetMonth(const ImPlotTime& t);Get month component from timestamp [0-11]
ImPlot::AddTime¶
IMPLOT_API ImPlotTime AddTime(const ImPlotTime& t, ImPlotTimeUnit unit, int count);Adds or subtracts time from a timestamp. #count > 0 to add, < 0 to subtract.
ImPlot::FloorTime¶
IMPLOT_API ImPlotTime FloorTime(const ImPlotTime& t, ImPlotTimeUnit unit);Rounds a timestamp down to nearest unit.
ImPlot::CeilTime¶
IMPLOT_API ImPlotTime CeilTime(const ImPlotTime& t, ImPlotTimeUnit unit);Rounds a timestamp up to the nearest unit.
ImPlot::RoundTime¶
IMPLOT_API ImPlotTime RoundTime(const ImPlotTime& t, ImPlotTimeUnit unit);Rounds a timestamp up or down to the nearest unit.
ImPlot::CombineDateTime¶
IMPLOT_API ImPlotTime CombineDateTime(const ImPlotTime& date_part, const ImPlotTime& time_part);Combines the date of one timestamp with the time-of-day of another timestamp.
ImPlot::Now¶
static inline ImPlotTime Now();Get the current time as a timestamp. (private API)
ImPlot::Today¶
static inline ImPlotTime Today();Get the current date as a timestamp. (private API)
ImPlot::FormatTimeStr¶
IMPLOT_API std::string FormatTimeStr(const ImPlotTime& t, ImPlotTimeFmt fmt, bool use_24_hr_clk);Formats the time part of timestamp t into a buffer according to #fmt
ImPlot::FormatDateStr¶
IMPLOT_API std::string FormatDateStr(const ImPlotTime& t, ImPlotDateFmt fmt, bool use_iso_8601);Formats the date part of timestamp t into a buffer according to #fmt
ImPlot::FormatDateTimeStr¶
IMPLOT_API std::string FormatDateTimeStr(const ImPlotTime& t, ImPlotDateTimeSpec fmt);Formats the time and/or date parts of a timestamp t into a buffer according to #fmt
ImPlot::ShowDatePicker¶
IMPLOT_API bool ShowDatePicker(const char* id, int* level, ImPlotTime* t, const ImPlotTime* t1 = nullptr, const ImPlotTime* t2 = nullptr);Shows a date picker widget block (year/month/day).
#level = 0 for day, 1 for month, 2 for year. Modified by user interaction.
#t will be set when a day is clicked and the function will return True.
#t1 and #t2 are optional dates to highlight.
ImPlot::ShowTimePicker¶
IMPLOT_API bool ShowTimePicker(const char* id, ImPlotTime* t);Shows a time picker widget block (hour/min/sec).
#t will be set when a new hour, minute, or sec is selected or am/pm is toggled, and the function will return True.
Transforms¶
ImPlot::TransformForward_Log10¶
static inline double TransformForward_Log10(double v, void*);(private API)
ImPlot::TransformInverse_Log10¶
static inline double TransformInverse_Log10(double v, void*);(private API)
ImPlot::TransformForward_SymLog¶
static inline double TransformForward_SymLog(double v, void*);(private API)
ImPlot::TransformInverse_SymLog¶
static inline double TransformInverse_SymLog(double v, void*);(private API)
ImPlot::TransformForward_Logit¶
static inline double TransformForward_Logit(double v, void*);(private API)
ImPlot::TransformInverse_Logit¶
static inline double TransformInverse_Logit(double v, void*);(private API)
Formatter_Time_Data (struct)¶
struct Formatter_Time_Data| Member | |
|---|---|
ImPlotTime Time; | |
ImPlotDateTimeSpec Spec; | |
void* UserFormatterData; |