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

Function Demo_CustomStyles

Source/3rdParty/implot/implot_demo.cpp:2581–2601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2579//-----------------------------------------------------------------------------
2580
2581void Demo_CustomStyles() {
2582 IMGUI_DEMO_MARKER("Custom/Custom Styles");
2583 ImPlot::PushColormap(ImPlotColormap_Deep);
2584 // normally you wouldn't change the entire style each frame
2585 ImPlotStyle backup = ImPlot::GetStyle();
2586 MyImPlot::StyleSeaborn();
2587 if (ImPlot::BeginPlot("seaborn style")) {
2588 ImPlot::SetupAxes( "x-axis", "y-axis");
2589 ImPlot::SetupAxesLimits(-0.5f, 9.5f, 0, 10);
2590 unsigned int lin[10] = {8,8,9,7,8,8,8,9,7,8};
2591 unsigned int bar[10] = {1,2,5,3,4,1,2,5,3,4};
2592 unsigned int dot[10] = {7,6,6,7,8,5,6,5,8,7};
2593 ImPlot::PlotBars("Bars", bar, 10, 0.5f);
2594 ImPlot::PlotLine("Line", lin, 10);
2595 ImPlot::NextColormapColor(); // skip green
2596 ImPlot::PlotScatter("Scatter", dot, 10);
2597 ImPlot::EndPlot();
2598 }
2599 ImPlot::GetStyle() = backup;
2600 ImPlot::PopColormap();
2601}
2602
2603//-----------------------------------------------------------------------------
2604

Callers

nothing calls this directly

Calls 11

PushColormapFunction · 0.85
StyleSeabornFunction · 0.85
BeginPlotFunction · 0.85
SetupAxesFunction · 0.85
SetupAxesLimitsFunction · 0.85
PlotBarsFunction · 0.85
PlotLineFunction · 0.85
NextColormapColorFunction · 0.85
PlotScatterFunction · 0.85
EndPlotFunction · 0.85
PopColormapFunction · 0.85

Tested by

no test coverage detected