MCPcopy Create free account
hub / github.com/brenocq/implot3d / DemoCustomStyles

Function DemoCustomStyles

implot3d_demo.cpp:1462–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1460//-----------------------------------------------------------------------------
1461
1462void DemoCustomStyles() {
1463 IMGUI_DEMO_MARKER("Custom/Custom Styles");
1464 ImPlot3D::PushColormap(ImPlot3DColormap_Deep);
1465 // normally you wouldn't change the entire style each frame
1466 ImPlot3DStyle backup = ImPlot3D::GetStyle();
1467 MyImPlot3D::StyleSeaborn();
1468 if (ImPlot3D::BeginPlot("Seaborn Style")) {
1469 ImPlot3D::SetupAxes("X-axis", "Y-axis", "Z-axis");
1470 ImPlot3D::SetupAxesLimits(-0.5, 9.5, -0.5, 0.5, 0, 10);
1471 unsigned int xs[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
1472 unsigned int ys[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1473 unsigned int lin[10] = {8, 8, 9, 7, 8, 8, 8, 9, 7, 8};
1474 unsigned int dot[10] = {7, 6, 6, 7, 8, 5, 6, 5, 8, 7};
1475 ImPlot3D::NextColormapColor(); // Skip blue
1476 ImPlot3D::PlotLine("Line", xs, ys, lin, 10);
1477 ImPlot3D::NextColormapColor(); // Skip green
1478 ImPlot3D::PlotScatter("Scatter", xs, ys, dot, 10);
1479 ImPlot3D::EndPlot();
1480 }
1481 ImPlot3D::GetStyle() = backup;
1482 ImPlot3D::PopColormap();
1483}
1484
1485void DemoCustomRendering() {
1486 IMGUI_DEMO_MARKER("Custom/Custom Rendering");

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected