Source: subplot_demo.f90
Demonstration of subplot functionality using the stateful API.
use fortplot, only: figure, plot, xlabel, ylabel, title, savefig, subplot
! Create figure and subplot grid call figure(800, 600) call subplot(rows, cols, index) ! Create grid and switch to subplot
! Add content to current subplot call plot(x, y) call title('Subplot Title') call xlabel('X Label') call ylabel('Y Label')
! Save entire subplot grid call savefig('output.png')
output/example/fortran/subplot_demo/subplot_2x2_demo.png: 2×2 grid showing sine, cosine, damped oscillation, and quadratic functionsoutput/example/fortran/subplot_demo/subplot_1x3_demo.png: 1×3 layout showing linear, quadratic, and cubic functions
Top-left: sin(x)
Bottom-right: Quadratic function x²/50
Left: Linear function x
subplot_demo.f90 - Source codeoutput/example/fortran/subplot_demo/make example ARGS="subplot_demo"

