Skip to content

watsonryan/gnuplotpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gnuplotpp

Pure C++20 plotting API with pluggable backends for publication-ready IEEE/AIAA figures.

Build

cmake --preset dev-debug
cmake --build --preset build-debug
ctest --preset test-debug

Architecture

flowchart LR
  A[FigureSpec/AxesSpec/SeriesSpec] --> B[Figure/Axes Containers]
  B --> C[IPlotBackend]
  C --> D[GnuplotBackend]
  C --> E[SvgBackend]
  D --> F[tmp/*.dat]
  D --> G[tmp/figure.gp]
  D --> H[figure.pdf|svg|eps|png]
  E --> I[figure.svg]
Loading

Render Flow

sequenceDiagram
  participant App as Example App (C++)
  participant Fig as gnuplotpp::Figure
  participant Be as Selected Backend

  App->>Fig: configure spec/layout + add series
  App->>Fig: save(out_dir)
  Fig->>Be: render(fig, out_dir)
  Be-->>Fig: RenderResult
  Fig-->>App: output paths
Loading

CMake Presets

  • dev-debug
  • dev-release
  • dev-cpm
  • build-debug
  • build-release
  • build-cpm
  • test-debug
  • test-release

CPM Dependencies (inside CMake)

CPM is optional via GNUPLOTPP_ENABLE_CPM=ON. When enabled, CMake downloads CPM.cmake and resolves C++ libraries (currently nlohmann_json).

Gnuplot and CPM

  • CPM is best for CMake/C++ dependencies.
  • gnuplot is an external CLI renderer.
  • Recommended: install gnuplot with system package managers and keep CPM for C++ libs.

No Separate Plot Command

You run only the C++ executable.

  • If gnuplot exists, examples render publication outputs (pdf/svg/png) via GnuplotBackend.
  • If gnuplot is missing, examples automatically fall back to native SvgBackend and still generate figure.svg.

Example Plots

./build/dev-debug/two_window_example --out out/two_window
./build/dev-debug/layout_2x2_example --out out/layout_2x2

Generated outputs include at least:

  • out/<name>/figures/figure.svg

About

C++20 plotting framework that generates publication-ready figures through native gnuplot backend

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors