GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - watsonryan/gnuplotpp: C++20 plotting framework that generates publication-ready figures through native gnuplot backend

BranchesTags
Open more actions menu

Latest commit

 

History

105 Commits
105 Commits

Folders and files

NameName
Last commit message
Last commit date
apps
apps
 
 
cmake
cmake
 
 
docs
docs
 
 
examples
examples
 
 
include/gnuplotpp
include/gnuplotpp
 
 
scripts
scripts
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
CMakePresets.json
CMakePresets.json
 
 
README.md
README.md
 
 

Repository files navigation

gnuplotpp

Pure C++20 plotting API with a gnuplot renderer for figures.

New Capability Set

  • Palette/color-cycle API (Default, Tab10, Viridis, Grayscale)
  • Secondary-axis (y2) series support
  • Shared-axis layout controls for multi-panel figures
  • Interactive preview script generation (interactive_preview)
  • Panel labels + figure caption metadata (panel_labels, caption)
  • Confidence bands (add_band)
  • Histogram, KDE, ECDF, percentile-band, and heatmap helpers
  • Fan-chart and violin uncertainty helpers
  • QQ plot, box summary, and confidence ellipse helpers
  • Rich legend controls (position, columns, box, opacity, font)
  • Tick/format controls (major step, minor count, format strings)
  • Text mode selection (Enhanced, Plain, LaTeX toggle)
  • Journal-like presets (IEEE_Tran, Nature_1Col, Elsevier_1Col)
  • Style profiles (Science, IEEE_Strict, AIAA_Strict, Presentation, DarkPrintSafe, Tufte_Minimal)
  • Typed annotations/objects (labels, arrows, rectangles)
  • Typed equation/callout annotations (equations, callouts)
  • Fluent FigureBuilder API
  • Quick-start helpers (make_quick_figure_spec, make_quick_figure, make_quick_axes)
  • One-shot publication helper (make_publication_figure)
  • Theme JSON save/load (save_theme_json / load_theme_json)
  • Data transforms (moving_average, downsample_uniform, autocorrelation)
  • Transform pipeline (TransformPipeline, z-score/clip/rolling)
  • Statistical model overlays (linear_fit, add_linear_fit_overlay)
  • CSV ingestion and unit-aware labels (read_csv_numeric, label_with_unit)
  • Faceting helpers (facet_grid, apply_facet_axes)
  • Composition helpers (apply_panel_titles, apply_shared_legend, apply_shared_colorbar_label)
  • Auto legend placement heuristic (auto_place_legend)
  • YAML declarative spec loading (load_yaml_figure_spec)
  • Template gallery and quick templates (apply_plot_template, write_template_gallery_yaml)
  • DataTable column plotting adapters (add_line, add_scatter)
  • Versioned theme presets (ThemePreset::*_v1)
  • CLI renderer (gnuplotpp_cli --spec ... --out ...)
  • Font fallback chain for cross-format typography consistency
  • Reproducibility manifest export (manifest.json)

Requirements

  • CMake >= 3.20
  • C++20 compiler
  • gnuplot (required for final figure generation)
  • yaml-cpp (required for YAML spec loading)

Install gnuplot:

# macOS
brew install gnuplot

# Ubuntu/Debian
sudo apt-get update && sudo apt-get install -y gnuplot libyaml-cpp-dev

# Fedora
sudo dnf install -y gnuplot yaml-cpp-devel

Build

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

Documentation

  • Documentation Index
  • API Contracts
  • Getting Started
  • Best Practices Quick Reference
  • Styling and Presets
  • Statistical Plot Guide
  • Examples Cookbook
  • Troubleshooting
  • Full Plot Controls

Refresh all README figure assets from current examples:

cmake --build --preset build-debug --target refresh-readme-assets
# or:
./scripts/refresh_readme_assets.sh

Architecture

flowchart LR
  subgraph Inputs
    Y[YAML Spec]
    C[CSV / Arrays]
    CPP[C++ API]
  end

  Y --> CLI[gnuplotpp_cli]
  C --> CLI
  CPP --> Core[FigureSpec / AxesSpec / SeriesSpec]
  CLI --> Core

  Core --> Ops[Transforms + Model Overlays + Statistics]
  Ops --> Fig[Figure / Axes]

  Fig --> Backend[IPlotBackend]
  Backend --> Gnuplot[GnuplotBackend]

  Gnuplot --> Dat[tmp/*.dat]
  Gnuplot --> Script[tmp/figure.gp]
  Gnuplot --> Out[figure.pdf / figure.svg / figure.eps / figure.png]
Loading

Publication Workflow

  1. Configure a publication preset (IEEE_SingleColumn, IEEE_DoubleColumn, AIAA_Column, AIAA_Page).
  2. Set output formats to vector (Pdf, Svg, optional Eps).
  3. Render via GnuplotBackend from your C++ executable.
  4. Use PDF as primary submission asset.

Publication Defaults in Renderer

  • Cairo terminals with enhanced text
  • Explicit line widths and rounded joins
  • Tick formatting and outward tics
  • Grid styling suitable for print
  • Escaped plot labels/titles for robust script generation

Strict IEEE Mode

When using IEEE_SingleColumn or IEEE_DoubleColumn, renderer behavior is tightened to print-safe defaults:

  • 8.5 pt Times-style text defaults
  • monochrome plotting by default (set monochrome)
  • dashed line-style differentiation per series (dt 1..N)
  • per-series color/opacity overrides disable global monochrome automatically
  • SciencePlots-like axis defaults: visible minor ticks, thin 0.5 axis/grid strokes
  • vector-first outputs (PDF, SVG, EPS)

Examples

./build/dev-debug/two_window_example --out out/two_window
./build/dev-debug/layout_2x2_example --out out/layout_2x2
./build/dev-debug/three_line_ieee_example --out out/three_line_ieee
./build/dev-debug/monte_carlo_alpha_example --out out/monte_carlo_alpha
./build/dev-debug/feature_rich_showcase --out out/feature_rich_showcase
./build/dev-debug/interactive_facet_example --out out/interactive_facet_example
./build/dev-debug/yaml_spec_example --out out/yaml_spec_example
./build/dev-debug/gnuplotpp_cli --spec examples/specs/minimal.yaml --out out/cli_run
./build/dev-debug/stats_plot_examples --out out/stats_plot_examples
./build/dev-debug/tufte_minimal_example --out out/tufte_minimal_example

Annotated IEEE Example

Generated from:

./build/dev-debug/three_line_ieee_example --out out/three_line_ieee_readme

Three-line IEEE example

Statistical Plot Gallery

Generated from:

./build/dev-debug/stats_plot_examples --out out/stats_plot_examples

Normal Q-Q:

Normal Q-Q plot example

Violin with raw samples:

Violin profile with sample points

Confidence ellipse:

1, 2, and 3-sigma confidence ellipses

Autocorrelation:

Autocorrelation example

Tufte Minimal Example

Generated from:

./build/dev-debug/tufte_minimal_example --out out/tufte_minimal_example

Direct labels, minimal framing, and low-ink reference guides:

Tufte minimal style example

Monte Carlo Ensemble (+/-3 Sigma)

Generated from:

./build/dev-debug/monte_carlo_alpha_example --out out/monte_carlo_alpha_example --npaths 1000 --lw 2 --alpha 0.3

Monte Carlo ensemble with plus/minus 3-sigma bounds

Expected outputs:

  • out/<name>/figures/figure.pdf
  • out/<name>/figures/figure.svg
  • out/<name>/figures/figure.eps
  • out/<name>/figures/tmp/figure.gp
  • out/<name>/figures/tmp/ax*_series*.dat

Detailed controls and recipes: Plot Controls

Error Handling

RenderResult.status values:

  • Success
  • InvalidInput
  • IoError
  • ExternalToolMissing
  • ExternalToolFailure
  • UnsupportedFormat

About

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

Topics

gnuplotgnuplot-cppgnuplot-graphsgnuplot-interfaceplottingplotting-in-cppvisulization

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.