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