Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Plotting Libraries

Dear ImGui Bundle includes two powerful plotting libraries for 2D and 3D visualization.

ImPlot - 2D Plotting

Introduction

ImPlot adds interactive 2D plots to your GUI: line charts, bar charts, scatter plots, heatmaps, and more. Plots support zooming, panning, and hover inspection.

Some of the many plot types supported by ImPlot.

Some of the many plot types supported by ImPlot.

Quick example:

Python
C++
from imgui_bundle import implot, immapp
import numpy as np

x = np.arange(0, 10, 0.1)
y = np.sin(x)

def gui():
    if implot.begin_plot("My Plot"):
        implot.plot_line("sin(x)", x, y)
        implot.end_plot()

immapp.run(gui, with_implot=True)

Full Demo

ImPlot demo showcasing various plot types and features.

ImPlot demo showcasing various plot types and features.

Documented APIs

ImPlot3D - 3D Plotting

Introduction

ImPlot3D extends ImPlot with 3D visualization capabilities. Create interactive 3D line plots, scatter plots, surface plots, and more with rotation, zoom, and pan controls.

Some of the plot types supported by ImPlot3D.

Some of the plot types supported by ImPlot3D.

Quick example:

Python
C++
from imgui_bundle import implot3d, immapp, hello_imgui
import numpy as np

t = np.linspace(0, 10, 100)
x, y, z = np.cos(t), np.sin(t), t

def gui():
    if implot3d.begin_plot("3D Helix", hello_imgui.em_to_vec2(30, 30)):
        implot3d.setup_axes("X", "Y", "Z")
        implot3d.plot_line("helix", x, y, z)
        implot3d.end_plot()

immapp.run(gui, with_implot3d=True)

Full Demo

The full demo for ImPlot3D is available online together with ImPlot’s full demo.

Try online

Documented APIs