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

Function SetupAxisTicks

Source/3rdParty/implot/implot.cpp:2242–2256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2240}
2241
2242void SetupAxisTicks(ImAxis idx, const double* values, int n_ticks, const char* const labels[], bool show_default) {
2243 ImPlotContext& gp = *GImPlot;
2244 IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr && !gp.CurrentPlot->SetupLocked,
2245 "Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!");
2246 ImPlotPlot& plot = *gp.CurrentPlot;
2247 ImPlotAxis& axis = plot.Axes[idx];
2248 IM_ASSERT_USER_ERROR(axis.Enabled, "Axis is not enabled! Did you forget to call SetupAxis()?");
2249 axis.ShowDefaultTicks = show_default;
2250 AddTicksCustom(values,
2251 labels,
2252 n_ticks,
2253 axis.Ticker,
2254 axis.Formatter ? axis.Formatter : Formatter_Default,
2255 (axis.Formatter && axis.FormatterData) ? axis.FormatterData : axis.HasFormatSpec ? axis.FormatSpec : (void*)IMPLOT_LABEL_FORMAT);
2256}
2257
2258void SetupAxisTicks(ImAxis idx, double v_min, double v_max, int n_ticks, const char* const labels[], bool show_default) {
2259 ImPlotContext& gp = *GImPlot;

Callers 4

Demo_BarGroupsFunction · 0.85
Demo_BarStacksFunction · 0.85
Demo_HeatmapsFunction · 0.85
Demo_TickLabelsFunction · 0.85

Calls 2

AddTicksCustomFunction · 0.85
FillRangeFunction · 0.85

Tested by

no test coverage detected