mirror of
https://github.com/gwm17/implot.git
synced 2025-01-31 03:18:51 -05:00
Merge branch 'master' into master
This commit is contained in:
commit
ceeb5b485c
10
README.md
10
README.md
|
@ -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();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user