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

Function Demo_LogScale

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

Source from the content-addressed store, hash-verified

1464//-----------------------------------------------------------------------------
1465
1466void Demo_LogScale() {
1467 IMGUI_DEMO_MARKER("Axes/Log Scale");
1468 static double xs[1001], ys1[1001], ys2[1001], ys3[1001];
1469 for (int i = 0; i < 1001; ++i) {
1470 xs[i] = i*0.1f;
1471 ys1[i] = sin(xs[i]) + 1;
1472 ys2[i] = log(xs[i]);
1473 ys3[i] = pow(10.0, xs[i]);
1474 }
1475 if (ImPlot::BeginPlot("Log Plot", ImVec2(-1,0))) {
1476 ImPlot::SetupAxisScale(ImAxis_X1, ImPlotScale_Log10);
1477 ImPlot::SetupAxesLimits(0.1, 100, 0, 10);
1478 ImPlot::PlotLine("f(x) = x", xs, xs, 1001);
1479 ImPlot::PlotLine("f(x) = sin(x)+1", xs, ys1, 1001);
1480 ImPlot::PlotLine("f(x) = log(x)", xs, ys2, 1001);
1481 ImPlot::PlotLine("f(x) = 10^x", xs, ys3, 21);
1482 ImPlot::EndPlot();
1483 }
1484}
1485
1486//-----------------------------------------------------------------------------
1487

Callers

nothing calls this directly

Calls 9

BeginPlotFunction · 0.85
ImVec2Function · 0.85
SetupAxisScaleFunction · 0.85
SetupAxesLimitsFunction · 0.85
PlotLineFunction · 0.85
EndPlotFunction · 0.85
sinFunction · 0.50
logFunction · 0.50
powFunction · 0.50

Tested by

no test coverage detected