Skip to article frontmatterSkip to article content

GitHub Release GitHub License Binder


G3P is a tiny but mighty header-only modern C++ interface library for Gnuplot.

Itโ€™s the most natural and intuitive way of adding Gnuplot support into any C++ program.

Itโ€™s also one of few C++ libraries to support embedding of plots in Jupyter notebooks.


Cool G3P Features ๐Ÿช„ยถ

๐Ÿช Rapid Prototyping with Jupyter

Using G3P you can embed plots in Jupyter notebooks running on Xeus-Cling kernel.

๐Ÿƒ Animated Plots

G3P supports embedding animated plots into Jupyter Notebooks in several ways.

๐Ÿ“ˆ Interactive Plots in Jupyter

G3P in combination with xwidgets can produce interactive plots in a Jupyter Notebook.

๐Ÿ”€ C & C++ Conventions Support

Both C (%d,%f, ...) and C++ (<<) conventions for passing arguments to Gnuplot are supported. You can even mix and match them.


Key Features ๐Ÿฅ‡ยถ

  • ๐Ÿ–ฅ๏ธ Multiplatform (Linux, macOS, Windows)
  • ๐Ÿ’ฅ No dependencies (except Gnuplot)
  • ๐Ÿ–‡๏ธ Header-only (only one header file)
  • ๐Ÿชถ Lightweight (~300 lines of code excluding comments)
  • โšก Fast (all i/o implemented with C API and C++11 threading)
  • ๐Ÿ“Š Support embedding plots in Jupyter Notebooks
  • ๐Ÿซ Easy to learn. If you know Gnuplot, youโ€™re already set.
  • ๐Ÿ“ฅ Easily integrates with existing libraries and code (via CMake configs)
  • โžก๏ธ Support fluent interface
  • ๐Ÿ”€ Support both C (%d,%f, ...) and C++ (<<) conventions for passing arguments
  • ๐Ÿงช Include unit tests
  • ๐Ÿ“– Well documented