Self-contained Fortran plotting library. Backends: PNG (raster), PDF (vector), ASCII. No libpng, no zlib, no Cairo — all custom by design; do not propose replacing them with external libraries.
src/— library (backends/,figures/,plotting/,text/, etc.)test/— FPM tests, organized into subdirectories by areaexample/— runnable examples, outputs tooutput/example/<name>/doc/— FORD source; built site lands inbuild/doc/Makefile— top-level entry; wraps fpm + verification gatesfpm.toml— package config (auto-discovery on)CMakeLists.txt— alternative build for downstreamFetchContent. Do not delete.
Primary dev workflow is fo (cmake/ninja under the hood, hash-cached; avoids the
flaky fpm parallel-build backend). Run it before every commit.
fo— full pipeline: build, test, lint, fmt hintfo build— build only (--debugadds-g -O0 -fcheck=all -fbacktrace)fo test <name>— run one test target;fo test --allruns allfo check— build + test, one-line statusfo lint/fo fmt(fo fmt --checkto verify without editing)
Make/fpm/CMake stay the CI and downstream build (do not remove):
make build/fpm build;make test/fpm test(all);make test-ci(fast CI subset)make verify-artifacts— rendering gate; nofoequivalent, so usemakehere. Required for any change that touches plots, ticks, labels, or backends.make example(regeneratesoutput/example/...);make doc(FORD →build/doc/index.html);make clean
fo test <name> or fpm test --target <name> runs one test.
- Free-form Fortran, no implicit typing. Use
use fortplot, only: wp => real64. - Modules < ~500 lines (hard ceiling 1000). Functions < 50 lines (hard 100).
- Exception:
src/figures/core/fortplot_figure_core_main.f90(817 lines) is a public API facade where Fortran requires allprocedure ::/generic ::type-bound interfaces in the same module as the type definition. Implementations are split across submodules. See issue #1925.
- Exception:
- Each
test/<area>/directory under 50 files (soft 20). Tests namedtest_*.f90. - Test artifacts go to
build/test/output/viasrc/testing/fortplot_test_helpers.f90, never to repo root. - Conventional Commit subjects:
fix:,feat:,docs:,refactor:,cleanup:.
For any visual change: run make verify-artifacts, then attach in the PR the commands you ran, the artifact paths, and a short text excerpt (e.g. from pdftotext) proving the label or curve is correct. PRs that affect rendering without this evidence do not merge.
GitHub Actions runs make example → copies outputs to doc/media/examples/<example>/ → FORD builds. Markdown in doc/examples/*.md references images as ../../media/examples/<example>/<file>.png. Preserve that subdirectory structure on both sides — don't flatten.
gh issue list --state open --limit 500(the default truncates to 30).- Search before filing:
gh issue list --state open --limit 500 --search "<keyword>". - Edit issue bodies (
gh issue edit) instead of piling comments. - Issues without external library replacement proposals — they violate the independence policy and get closed on sight.
fo build(ormake build) succeeds.fo check/fo test --all(ormake test, at leastmake test-ci) passes — no skipped or weakened tests.- For rendering changes:
make verify-artifactspasses and the evidence is attached. - Changed Fortran is fmt-clean (
fo fmt --check), and no new file exceeds the size limits above.