subplot_demo Program

Demonstration of subplot functionality using the stateful API

This example demonstrates: - 2x2 subplot grid layout with sin, cos, damped oscillation, and quadratic functions - 1x3 subplot horizontal layout with linear, quadratic, and cubic functions - Independent titles and labels per subplot - Different mathematical functions visualized in each subplot

API Usage: - subplot(rows, cols, index) to create subplot grid and switch to specific subplot - plot(), title(), xlabel(), ylabel() work within current subplot context - savefig() renders entire subplot grid to output file


Variables

Type Attributes Name Initial
integer, parameter :: FINE_POINTS = 100
integer, parameter :: COARSE_POINTS = 50
real(kind=wp), parameter :: FINE_STEP = 0.1_wp
real(kind=wp), parameter :: COARSE_STEP = 0.2_wp
real(kind=wp), parameter :: DAMPING_FACTOR = 0.5_wp
real(kind=wp), parameter :: OSCILLATION_FREQ = 2.0_wp
real(kind=wp), parameter :: QUADRATIC_SCALE = 50.0_wp
integer, parameter :: FIG_2X2_WIDTH = 800
integer, parameter :: FIG_2X2_HEIGHT = 600
integer, parameter :: FIG_1X3_WIDTH = 900
integer, parameter :: FIG_1X3_HEIGHT = 300
real(kind=wp), allocatable :: x(:)
real(kind=wp), allocatable :: y(:)
real(kind=wp), allocatable :: x2(:)
real(kind=wp), allocatable :: y2(:)
integer :: i