arminms
g3p
CMake

Modern C++ interface library for Gnuplot with Jupyter support

Last updated Feb 15, 2026
37
Stars
0
Forks
0
Issues
0
Stars/day
Attention Score
11
Language breakdown
CMake 38.3%
C++ 32.7%
Dockerfile 28.9%
Files click to expand
README

G3P

GitHub Release GitHub License Build and Test (Linux/macOS/Windows) GitHub issues view documentation Binder

G3P (GnuPlot Plus Plus) is a tiny but mighty header-only Modern C++ interface library for gnuplot. It is the most natural and intuitive way of adding gnuplot support to any C++ program.

A unique feature of G3P is the ability to embed plots/animations in Jupyter C++ Notebooks with Xeus-Cling kernel for rapid prototyping. If you have Docker, an easy way to learn about this feature is to run the prebuilt container:

docker run -p 8888:8888 -it --rm asobhani/g3p
Then click on the provided URL to connect to the Jupyter Server in the container and open 01thebasics.ipynb notebook.

If you don't have Docker, an easier but much slower way is to click on Binder badge to launch it on Binder.

Key features include:

  • 🖥️ Multiplatform (Linux/macOS/Windows)
  • 💥 No dependencies (except gnuplot)
  • 🖇️ Header-only (only one header file)
  • 🪶 Lightweight (~300 lines of code)
  • ⚡ Fast (all i/o implemented with C API and C++11 threading)
  • 📊 Support embedding plots/animations in Jupyter C++ Notebooks backed by Xeus-Cling kernel
  • 🏫 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 to gnuplot
  • 🧪 Include Catch2 unit tests
  • 📖 Well documented

Quick example

++
#include <g3p/gnuplot>

g3p::gnuplot gp; gp << "set samples" << 200 << "\n" << "set style data points\n" << "plot [-10:10] sin(x),atan(x),cos(atan(x))\n"

Please refer to the interactive documentation for more information: 👉 view documentation 👈

🔗 More in this category

© 2026 GitRepoTrend · arminms/g3p · Updated daily from GitHub