mirror of
https://github.com/gwm17/implot.git
synced 2024-11-23 02:38:53 -05:00
update readme
This commit is contained in:
parent
10a58c52ca
commit
9974ce1a30
17
README.md
17
README.md
|
@ -29,7 +29,7 @@ ImPlot is an immediate mode, GPU accelerated plotting library for [Dear ImGui](h
|
||||||
- and more likely to come
|
- and more likely to come
|
||||||
- mix/match multiple plot items on a single plot
|
- mix/match multiple plot items on a single plot
|
||||||
- configurable axes ranges and scaling (linear/log)
|
- configurable axes ranges and scaling (linear/log)
|
||||||
- time formatted x-axes
|
- time formatted x-axes (US formatted or ISO 8601)
|
||||||
- reversible and lockable axes
|
- reversible and lockable axes
|
||||||
- up to three independent y-axes
|
- up to three independent y-axes
|
||||||
- controls for zooming, panning, box selection, and auto-fitting data
|
- controls for zooming, panning, box selection, and auto-fitting data
|
||||||
|
@ -38,7 +38,7 @@ ImPlot is an immediate mode, GPU accelerated plotting library for [Dear ImGui](h
|
||||||
- several plot styling options: 10 marker types, adjustable marker sizes, line weights, outline colors, fill colors, etc.
|
- several plot styling options: 10 marker types, adjustable marker sizes, line weights, outline colors, fill colors, etc.
|
||||||
- 10 built-in and user definable colormaps
|
- 10 built-in and user definable colormaps
|
||||||
- optional plot titles, axis labels, and grid labels
|
- optional plot titles, axis labels, and grid labels
|
||||||
- optional legend with toggle buttons to quickly show/hide items
|
- optional and configurable legends with toggle buttons to quickly show/hide plot items
|
||||||
- default styling based on current ImGui theme, but most elements can be customized independently
|
- default styling based on current ImGui theme, but most elements can be customized independently
|
||||||
- customizable data getters and data striding (just like ImGui:PlotLine)
|
- customizable data getters and data striding (just like ImGui:PlotLine)
|
||||||
- accepts data as float, double, and 8, 16, 32, and 64-bit signed/unsigned integral types
|
- accepts data as float, double, and 8, 16, 32, and 64-bit signed/unsigned integral types
|
||||||
|
@ -46,7 +46,7 @@ ImPlot is an immediate mode, GPU accelerated plotting library for [Dear ImGui](h
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The API is used just like any other ImGui `BeginX`/`EndX` pair. First, start a new plot 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!
|
The API is used just like any other ImGui `BeginX`/`EndX` pair. First, start a new plot with `ImPlot::BeginPlot()`. Next, plot as many items as you want with the provided `PlotX` functions (e.g. `PlotLine()`, `PlotBars()`, `PlotScatter()`, etc). Finally, wrap things up with a call to `ImPlot::EndPlot()`. That's it!
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
int bar_data[11] = ...;
|
int bar_data[11] = ...;
|
||||||
|
@ -96,6 +96,7 @@ If you want to test ImPlot quickly, consider trying [mahi-gui](https://github.co
|
||||||
1) Handle the `ImGuiBackendFlags_RendererHasVtxOffset` flag in your renderer when using 16-bit indices (the official OpenGL3 renderer supports this) and use an ImGui version with patch [imgui@f6120f8](https://github.com/ocornut/imgui/commit/f6120f8e16eefcdb37b63974e6915a3dd35414be), OR...
|
1) Handle the `ImGuiBackendFlags_RendererHasVtxOffset` flag in your renderer when using 16-bit indices (the official OpenGL3 renderer supports this) and use an ImGui version with patch [imgui@f6120f8](https://github.com/ocornut/imgui/commit/f6120f8e16eefcdb37b63974e6915a3dd35414be), OR...
|
||||||
2) Enable 32-bit indices by uncommenting `#define ImDrawIdx unsigned int` in your ImGui `imconfig.h` file.
|
2) Enable 32-bit indices by uncommenting `#define ImDrawIdx unsigned int` in your ImGui `imconfig.h` file.
|
||||||
- By default, no anti-aliasing is done on line plots for performance gains. If you use 4x MSAA, then you likely won't even notice. However, you can enable software AA per-plot with the `ImPlotFlags_AntiAliased` flag, or globally with `ImPlot::GetStyle().AntiAliasedLines = true;`.
|
- By default, no anti-aliasing is done on line plots for performance gains. If you use 4x MSAA, then you likely won't even notice. However, you can enable software AA per-plot with the `ImPlotFlags_AntiAliased` flag, or globally with `ImPlot::GetStyle().AntiAliasedLines = true;`.
|
||||||
|
- Like ImGui, it is recommended that you compile and link ImPlot as a *static* library or directly as a part of your sources. However, if you are compiling ImPlot and ImGui as separate DLLs, make sure you set the current *ImGui* context with `ImPlot::SetImGuiContext(ImGuiContext* ctx)`. This ensures that global ImGui variables are correctly shared across the DLL boundary.
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
@ -107,13 +108,17 @@ A: ImGui is an incredibly powerful tool for rapid prototyping and development, b
|
||||||
|
|
||||||
A: If you're looking to generate publication quality plots and/or export plots to a file, ImPlot is NOT the library for you. ImPlot is geared toward plotting application data at realtime speeds. ImPlot does its best to create pretty plots (indeed, there are quite a few styling options available), but it will always favor function over form.
|
A: If you're looking to generate publication quality plots and/or export plots to a file, ImPlot is NOT the library for you. ImPlot is geared toward plotting application data at realtime speeds. ImPlot does its best to create pretty plots (indeed, there are quite a few styling options available), but it will always favor function over form.
|
||||||
|
|
||||||
|
**Q: Where is the documentation?**
|
||||||
|
|
||||||
|
A: The API is thoroughly commented in `implot.h`, and the demo in `implot_demo.cpp` should be more than enough to get you started.
|
||||||
|
|
||||||
**Q: Is ImPlot suitable for plotting large datasets?**
|
**Q: Is ImPlot suitable for plotting large datasets?**
|
||||||
|
|
||||||
A: Yes, within reason. You can plot tens to hundreds of thousands of points without issue, but don't expect millions to be a buttery smooth experience. However, you can downsample extremely large datasets by telling ImPlot to stride your data at larger intervals if needed.
|
A: Yes, within reason. You can plot tens to hundreds of thousands of points without issue, but don't expect millions to be a buttery smooth experience. That said, you can always downsample extremely large datasets by telling ImPlot to stride your data at larger intervals if needed.
|
||||||
|
|
||||||
**Q: Can plot styles be modified?**
|
**Q: Can plot styles be modified?**
|
||||||
|
|
||||||
A: Yes. Plot colors, palettes, and various styling variables can be pushed/popped or modified permanently on startup. Three default styles are available, as well as an automatic style that attempts to match you ImGui style.
|
A: Yes. Data colormaps and various styling colors and variables can be pushed/popped or modified permanently on startup. Three default styles are available, as well as an automatic style that attempts to match you ImGui style.
|
||||||
|
|
||||||
**Q: Does ImPlot support logarithmic scaling or time formatting?**
|
**Q: Does ImPlot support logarithmic scaling or time formatting?**
|
||||||
|
|
||||||
|
@ -146,7 +151,7 @@ A: Not currently. Use your OS's screen capturing mechanisms if you need to captu
|
||||||
**Q: What data types can I plot?**
|
**Q: What data types can I plot?**
|
||||||
|
|
||||||
A: ImPlot plotting functions accept most scalar types:
|
A: ImPlot plotting functions accept most scalar types:
|
||||||
`float`, `double`, `int8`, `uint8`, `int16`, `uint16`, `int32`, `uint32`, `int64`, `uint64`.
|
`float`, `double`, `int8`, `uint8`, `int16`, `uint16`, `int32`, `uint32`, `int64`, `uint64`. Arrays of custom structs or classes (e.g. `Vector2f` or similar) are easily passed to ImPlot functions using the built in striding features (see `implot.h` for documentation).
|
||||||
|
|
||||||
**Q: Can ImPlot be used with other languages/bindings?**
|
**Q: Can ImPlot be used with other languages/bindings?**
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user