MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / SetupAxis

Function SetupAxis

Source/3rdParty/implot/implot.cpp:2173–2192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2171//-----------------------------------------------------------------------------
2172
2173void SetupAxis(ImAxis idx, const char* label, ImPlotAxisFlags flags) {
2174 ImPlotContext& gp = *GImPlot;
2175 IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr && !gp.CurrentPlot->SetupLocked,
2176 "Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!");
2177 // get plot and axis
2178 ImPlotPlot& plot = *gp.CurrentPlot;
2179 ImPlotAxis& axis = plot.Axes[idx];
2180 // set ID
2181 axis.ID = plot.ID + idx + 1;
2182 // check and set flags
2183 if (plot.JustCreated || flags != axis.PreviousFlags)
2184 axis.Flags = flags;
2185 axis.PreviousFlags = flags;
2186 // enable axis
2187 axis.Enabled = true;
2188 // set label
2189 plot.SetAxisLabel(axis,label);
2190 // cache colors
2191 UpdateAxisColors(axis);
2192}
2193
2194void SetupAxisLimits(ImAxis idx, double min_lim, double max_lim, ImPlotCond cond) {
2195 ImPlotContext& gp = *GImPlot;

Callers 9

Demo_CustomScaleFunction · 0.85
Demo_MultipleAxesFunction · 0.85
Demo_EqualAxesFunction · 0.85
Demo_TagsFunction · 0.85
Demo_DragAndDropFunction · 0.85
Demo_TickLabelsFunction · 0.85
SetupAxesFunction · 0.85
BeginPlotFunction · 0.85
showStatsMethod · 0.85

Calls 2

UpdateAxisColorsFunction · 0.85
SetAxisLabelMethod · 0.80

Tested by

no test coverage detected