1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-23 02:38:53 -05:00

update readme

This commit is contained in:
Evan Pezent 2020-05-16 09:21:01 -05:00
parent 3421c26270
commit 98ff9e8795

View File

@ -32,12 +32,12 @@ ImPlot is an immediate mode plotting widget for [Dear ImGui](https://github.com/
## Usage ## Usage
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! 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 `PlotX` functions (e.g. `PlotLine()`, `PlotBars()`, `PlotErrorBars()`, etc). Finally, wrap things up with a call to `ImPlot::EndPlot()`. That's it!
```cpp ```cpp
if (ImPlot::BeginPlot("My Plot")) { if (ImPlot::BeginPlot("My Plot")) {
ImPlot::Plot("My Line Plot", x_data, y_data, 1000); ImPlot::PlotLine("My Line Plot", x_data, y_data, 1000);
ImPlot::Bar("My Bar Plot", values, 10); ImPlot::PlotBars("My Bar Plot", values, 10);
... ...
ImPlot::EndPlot(); ImPlot::EndPlot();
} }