ImPlot: 2D plots for Dear ImGui: lines, scatter, bars, shaded areas, heatmaps, histograms, pie charts, real-time data.
A plot lives between begin_plot() and end_plot(): the setup_* functions (axes, limits, legend) come first,
then the plot_* functions. Run the app with immapp.run(..., with_implot=True), which creates ImPlot’s context.
In Python, the data are numpy arrays. ImPlot’s functions are templated on one numeric type, so the arrays of one
call must share their dtype: convert them first (xs = xs.astype(ys.dtype)). Mismatched dtypes raise an error.
Upstream repository · The book’s page
Modules¶
In imgui_bundle (from imgui_bundle import implot):
implot: 125 functions, 8 classes, 36 enums · the C++ viewimplot.internal: 91 functions, 21 classes, 4 enums · the C++ view
Demos using it¶
The demos of the catalog that use it (the pictures link to their code and to the playground).

A parametric curve¶
Turn the knobs, or click Random: the curve follows at once.
More
At every frame, the GUI function draws the plot with ImPlot and the knobs with imgui-knobs, and reads their values right there. No callbacks, no widget objects: that is the immediate mode.
Uses: ImPlot, knobs

Assets and add-ons¶
Load images and icons from your assets folder, and use two add-ons: markdown and ImPlot.
More
A markdown editor with a live preview, and a pie chart whose values you can drag. Tick More info under each part to see how it is done. The add-ons are activated with immapp.AddOnsParams.
Uses: ImPlot

A tiny neural network learns two spirals¶
Can 16 neurons tell two spirals apart? Watch a tiny neural network learn, live, as in the TensorFlow Playground.
More
Then read how it works, formula by formula, next to its numpy code.
Uses: ImPlot

Simple harmonic motion¶
A mass on a spring, a pendulum, a vibrating string: they all follow the same equation.
More
It is the equation of simple harmonic motion (for the pendulum, at small angles). Adjust the mass and the spring stiffness, and watch how the motion changes.
Uses: ImPlot, knobs

Double pendulum¶
A double pendulum is a chaotic system: tiny changes in its initial conditions lead to wildly different trajectories.
More
Drag the angles to set initial positions, then release and watch chaos unfold.
Uses: ImPlot, knobs, toggles

Fourier epicycles¶
Any closed curve can be approximated by a sum of rotating circles (a Fourier series).
More
Adjust the number of circles to see how the approximation improves.
Uses: ImPlot, knobs, toggles

Logistic map¶
A very simple equation, and yet it can lead to wildly different behaviors, up to chaos.
More
The logistic map, x(n+1) = r * x(n) * (1 - x(n)), models for example the growth of a population with limited resources. Depending on r, it is stable, periodic (in 2-cycles, 4-cycles, etc), or chaotic. Let’s explore this.
Uses: ImPlot, toggles

Node editor: an image pipeline¶
An image flows through a graph of filters, and each node shows its result.
More
Change a parameter, and the nodes downstream follow at once. The patterns of imgui-node-editor for a real app: typed pins, links refused with a reason, a node created by dropping a link in empty space, menus, a group.
Uses: ImPlot, ImmVision, node editor, OpenCV

ImPlot: the interactive manual¶
Every kind of plot of ImPlot, section by section, with the code of each beside it.
More
Lines, scatter, bars, heatmaps, histograms, real-time plots and more, in Python and C++. From Dear ImGui Explorer, the interactive manual for Dear ImGui and its libraries.
Uses: ImPlot

Context managers (imgui_ctx)¶
In Python, with imgui_ctx.begin("Window"): replaces a begin() / end() pair, and the end() can no longer be forgotten.
More
The same exists for child windows, menus, popups, tables, tabs, fonts and styles, and for ImPlot with implot_ctx. Open a section to try it and read its code. See the Python tips.
Uses: ImPlot


