nim_implot icon indicating copy to clipboard operation
nim_implot copied to clipboard

Nim binding for ImPlot / CImPlot with ImGui / CImGui

  • Nim ImPlot binding
  • Direct nimble install from Web
  • Runing all demo programs
  • Compiling application
  • Notice: Compilation options
  • Generating ImPlot bindings for development
  • Development
  • Tools info
  • Example gallery written in Nim language
    • Plots
      • LinePlots.nim
      • FilledLinePlots.nim
      • ShadedPlots.nim
      • ScatterPlots.nim
      • RealTimePlots.nim
      • StairstepPlots.nim
      • BarGroups.nim
      • BarPlots.nim
      • BarStacks.nim
      • ErrorBars.nim
      • StemPlots.nim
      • InfiniteLines.nim
      • PieCharts.nim
      • HeatMaps.nim
      • Histogram.nim
      • DigitalPlots.nim
      • Images.nim
      • MarkersAndText.nim
      • NaNValues.nim
    • Subplots
      • Tables.nim
      • ItemSharing.nim
    • Axes
      • LogScale.nim
      • MultipleAxes.nim
    • Tools
      • OffsetAndStride.nim
      • DragRects.nim
      • DragAndDrop.nim
    • Custom
      • CustomDataAndGetters.nim

Nim ImPlot binding


ImPlot is an immediate mode, GPU accelerated plotting library for Dear ImGui.

  1. This project uses the modified generator that derived from the achievement of Nimgl/imgui and nimgl-imgui(forked).
  2. This project also uses ImGui library (nim-imgui (ImGui v1.89.9 latest)) derived from Nimgl/imgui and nimgl-imgui(forked).
  3. Also have used CImGui library

Direct nimble install from Web


nimble install https://github.com/dinau/nim_implot

Runing all demo programs


git clone --recursive https://github.com/dinau/nim_implot
cd nim_implot
nimble test

Test source: examples/demo

Compiling application


It has to be used cpp backend at compilation for example,

pwd
nim_implot
cd examples/demo
nim cpp -r ImPlotDemo.nim 

Note: C backend is not supported.

Notice: Compilation options


If demo programs crash, please try to specify compilation option
--mm:refc instead of --mm:arc or --mm:orc,
especially if you use Nim-2.00, try to specify --mm:refc.
These are TODO at this moment.

Generating ImPlot bindings for development


pwd
nim_implot
nimble gen

Genarated file: src/implot.nim

Development


It is currently being developed and tested on

  • Windows 10

  • (Debian 12 Bookworm)

    $ sudo apt install xorg-dev libopengl-dev libgl1-mesa-dev
    

Tools info


  • Windows10
    • Nim Compiler Version 1.6.14
    • gcc.exe (Rev2, Built by MSYS2 project) 13.2.0
  • Debian 12 Bookworm
    • Nim Compiler Version 1.6.14
    • gcc (Debian 12.2.0-14) 12.2.0

Example gallery written in Nim language


Now all demo (over 50) programs have been implemented in Nim language (2023/10),
(Orignal demo program is here implot_demo.cpp, (C++))
below images are part of them.

Plots


LinePlots.nim

alt

FilledLinePlots.nim

alt

ShadedPlots.nim

alt

ScatterPlots.nim

alt

RealTimePlots.nim

alt

StairstepPlots.nim

alt

BarGroups.nim

alt

BarPlots.nim

alt

BarStacks.nim

alt

ErrorBars.nim

alt

StemPlots.nim

alt

InfiniteLines.nim

alt

PieCharts.nim

alt

HeatMaps.nim

alt

Histogram.nim

alt

DigitalPlots.nim

alt

Images.nim

alt

MarkersAndText.nim

alt

NaNValues.nim

alt

Subplots


Tables.nim

alt

ItemSharing.nim

alt

Axes


LogScale.nim

alt

MultipleAxes.nim

alt

Tools


OffsetAndStride.nim

alt

DragRects.nim

alt

DragAndDrop.nim

alt

Custom


CustomDataAndGetters.nim

alt