1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-10-09 23:57:26 -04:00

Merge branch 'master' into master

This commit is contained in:
ozlb 2020-05-12 11:21:35 +02:00 committed by GitHub
commit ceeb5b485c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,14 +32,14 @@ ImPlot is an immediate mode plotting widget for [Dear ImGui](https://github.com/
## Usage ## Usage
The API is used just like any other ImGui `Begin`/`End` function. First, start a plotting context with `BeginPlot()`. Next, plot as many items as you want with the provided API functions (e.g. `Plot()`, `PlotBar()`, `PlotErrorBars()`, etc). Finally, wrap things up with a call to `EndPlot()`. That's it! The API is used just like any other ImGui `BeginX`/`EndX` pair. First, start a plotting context with `ImPlot::BeginPlot()`. Next, plot as many items as you want with the provided API functions (e.g. `Plot()`, `Bar()`, `ErrorBars()`, etc). Finally, wrap things up with a call to `ImPlot::EndPlot()`. That's it!
```cpp ```cpp
if (ImGui::BeginPlot("My Plot")) { if (ImPlot::BeginPlot("My Plot")) {
ImGui::Plot("My Line Plot", x_data, y_data, 1000); ImPlot::Plot("My Line Plot", x_data, y_data, 1000);
ImGui::PlotBar("My Bar Plot", values, 10); ImPlot::Bar("My Bar Plot", values, 10);
... ...
ImGui::EndPlot(); ImPlot::EndPlot();
} }
``` ```