From 3a34ecfc2b3ce894ad77d29333cf8db268e52ffd Mon Sep 17 00:00:00 2001 From: Evan Pezent Date: Sun, 26 Apr 2020 17:13:22 -0500 Subject: [PATCH] Update README.md --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d2a73f1..dec638e 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,20 @@ # ImPlot -ImPlot is an advanced 2D plotting widget for Dear ImGui. +ImPlot is an immediate mode plotting widget for Dear ImGui. It aims to provide a first-class API that will make ImGui users feel right at home. ## Features - mutliple plot types: line, scatter, virtical/horizontal bars, stem, error bars - mix/match multiple plot items on a single plot +- zooming, panning, and box selection controls - several plot styling options: 10 marker types, adjustable marker sizes, line weights, outline colors, fill colors, etc. - optional plot titles, axis labels, and grid labels -- legend with toggle buttons to show/hide items +- optional legend with toggle buttons to show/hide items - reversible and lockable axes - logarithmic axis scaling -- size-aware, auto subdividing grid -- auto styling based on current theme, but most elements can be overridden -- nice grid labels that are always power-of-ten multiples of 1, 2, and 5 -- mouse cursor location display and optional crosshairs mode +- size-aware grid with smart labels that are always power-of-ten multiples of 1, 2, and 5 +- default styling based on current ImGui theme, but most elements can be customized independently +- mouse cursor location display and optional crosshairs cursor +- customizable data getters and data striding (just like ImGui:PlotLines) - relatively good performance for high density plots ## Controls @@ -25,13 +26,19 @@ ImPlot is an advanced 2D plotting widget for Dear ImGui. ## 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! + ```cpp if (ImGui::BeginPlot("My Plot") { - ImGui::Plot("Line Plot", xs ys, 1000); + ImGui::Plot("My Line Plot", xs ys, 1000); + ImGui::PlotBar("My Bar Plot", values, 20); + ... ImGui::EndPlot(); } ``` +Consult `implot_demo.cpp` for a full run down of features. + ## Special Notes - By default, no anti-aliasing is done on line plots for performance reasons. My apps use 4X MSAA, so I didn't see any reason to waste cycles on software AA. However, you can enable AA with the `ImPlotFlags_AntiAliased` flag. - If you plan to render several thousands lines or points, then you should consider enabling 32-bit indices by uncommenting `#define ImDrawIdx unsigned int` in your `imconfig.h` file, OR handling the `ImGuiBackendFlags_RendererHasVtxOffset` flag in your renderer (the official OpenGL3 renderer supports this). If you fail to do this, then you may at some point hit the maximum number of indices that can be rendered.