| 1464 | //----------------------------------------------------------------------------- |
| 1465 | |
| 1466 | void 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 |
nothing calls this directly
no test coverage detected