Main figure class - coordinates plotting operations Now uses composition of focused modules for better organization
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(figure_state_t), | public | :: | state | ||||
type(plot_data_t), | public, | allocatable | :: | plots(:) | |||
type(plot_data_t), | public, | allocatable | :: | streamlines(:) | |||
type(arrow_data_t), | public, | allocatable | :: | arrow_data(:) | |||
type(text_annotation_t), | public, | allocatable | :: | annotations(:) | |||
integer, | public | :: | annotation_count | = | 0 | ||
integer, | public | :: | max_annotations | = | 1000 | ||
integer, | public | :: | subplot_rows | = | 0 | ||
integer, | public | :: | subplot_cols | = | 0 | ||
integer, | public | :: | current_subplot | = | 1 | ||
type(subplot_data_t), | public, | allocatable | :: | subplots_array(:,:) | |||
character(len=:), | public, | allocatable | :: | title | |||
character(len=:), | public, | allocatable | :: | xlabel | |||
character(len=:), | public, | allocatable | :: | ylabel | |||
integer, | public | :: | plot_count | = | 0 |
Finalize and clean up figure
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(figure_t), | intent(inout) | :: | self |
Initialize the figure with specified dimensions and backend
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
integer, | intent(in), | optional | :: | width | ||
integer, | intent(in), | optional | :: | height | ||
character(len=*), | intent(in), | optional | :: | backend |
Add a line plot to the figure
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | x(:) | |||
real(kind=wp), | intent(in) | :: | y(:) | |||
character(len=*), | intent(in), | optional | :: | label | ||
character(len=*), | intent(in), | optional | :: | linestyle | ||
real(kind=wp), | intent(in), | optional | :: | color(3) |
Add a contour plot to the figure
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | x_grid(:) | |||
real(kind=wp), | intent(in) | :: | y_grid(:) | |||
real(kind=wp), | intent(in) | :: | z_grid(:,:) | |||
real(kind=wp), | intent(in), | optional | :: | levels(:) | ||
character(len=*), | intent(in), | optional | :: | label |
Add a filled contour plot with color mapping
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | x_grid(:) | |||
real(kind=wp), | intent(in) | :: | y_grid(:) | |||
real(kind=wp), | intent(in) | :: | z_grid(:,:) | |||
real(kind=wp), | intent(in), | optional | :: | levels(:) | ||
character(len=*), | intent(in), | optional | :: | colormap | ||
logical, | intent(in), | optional | :: | show_colorbar | ||
character(len=*), | intent(in), | optional | :: | label |
Add a pcolormesh plot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | x(:) | |||
real(kind=wp), | intent(in) | :: | y(:) | |||
real(kind=wp), | intent(in) | :: | c(:,:) | |||
character(len=*), | intent(in), | optional | :: | colormap | ||
real(kind=wp), | intent(in), | optional | :: | vmin | ||
real(kind=wp), | intent(in), | optional | :: | vmax | ||
real(kind=wp), | intent(in), | optional | :: | edgecolors(3) | ||
real(kind=wp), | intent(in), | optional | :: | linewidths |
Add streamline plot to figure using basic algorithm
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | x(:) | |||
real(kind=wp), | intent(in) | :: | y(:) | |||
real(kind=wp), | intent(in) | :: | u(:,:) | |||
real(kind=wp), | intent(in) | :: | v(:,:) | |||
real(kind=wp), | intent(in), | optional | :: | density | ||
real(kind=wp), | intent(in), | optional | :: | color(3) | ||
real(kind=wp), | intent(in), | optional | :: | linewidth | ||
real(kind=wp), | intent(in), | optional | :: | rtol | ||
real(kind=wp), | intent(in), | optional | :: | atol | ||
real(kind=wp), | intent(in), | optional | :: | max_time |
Save figure to file (backward compatibility version)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | filename | |||
logical, | intent(in), | optional | :: | blocking |
Save figure to file with error status reporting
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | filename | |||
integer, | intent(out) | :: | status | |||
logical, | intent(in), | optional | :: | blocking |
Set x-axis label
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | label |
Set y-axis label
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | label |
Set figure title
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | title |
Set x-axis scale type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | scale | |||
real(kind=wp), | intent(in), | optional | :: | threshold |
Set y-axis scale type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | scale | |||
real(kind=wp), | intent(in), | optional | :: | threshold |
Set x-axis limits
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | x_min | |||
real(kind=wp), | intent(in) | :: | x_max |
Set y-axis limits
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | y_min | |||
real(kind=wp), | intent(in) | :: | y_max |
Set line width for subsequent plots
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | width |
Update y data for an existing plot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | plot_index | |||
real(kind=wp), | intent(in) | :: | y_new(:) |
Add legend to figure
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | location |
Display the figure
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
logical, | intent(in), | optional | :: | blocking |
Clear streamline data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self |
Enable/disable and configure grid lines
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
logical, | intent(in), | optional | :: | enabled | ||
character(len=*), | intent(in), | optional | :: | which | ||
character(len=*), | intent(in), | optional | :: | axis | ||
real(kind=wp), | intent(in), | optional | :: | alpha | ||
character(len=*), | intent(in), | optional | :: | linestyle |
Create a histogram plot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | data(:) | |||
integer, | intent(in), | optional | :: | bins | ||
logical, | intent(in), | optional | :: | density | ||
character(len=*), | intent(in), | optional | :: | label | ||
real(kind=wp), | intent(in), | optional | :: | color(3) |
Create a box plot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | data(:) | |||
real(kind=wp), | intent(in), | optional | :: | position | ||
real(kind=wp), | intent(in), | optional | :: | width | ||
character(len=*), | intent(in), | optional | :: | label | ||
logical, | intent(in), | optional | :: | show_outliers | ||
logical, | intent(in), | optional | :: | horizontal | ||
character(len=*), | intent(in), | optional | :: | color |
Add an efficient scatter plot using a single plot object Properly handles thousands of points without O(n) overhead
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | x(:) | |||
real(kind=wp), | intent(in) | :: | y(:) | |||
real(kind=wp), | intent(in), | optional | :: | s(:) | ||
real(kind=wp), | intent(in), | optional | :: | c(:) | ||
character(len=*), | intent(in), | optional | :: | marker | ||
real(kind=wp), | intent(in), | optional | :: | markersize | ||
real(kind=wp), | intent(in), | optional | :: | color(3) | ||
character(len=*), | intent(in), | optional | :: | colormap | ||
real(kind=wp), | intent(in), | optional | :: | alpha | ||
real(kind=wp), | intent(in), | optional | :: | edgecolor(3) | ||
real(kind=wp), | intent(in), | optional | :: | facecolor(3) | ||
real(kind=wp), | intent(in), | optional | :: | linewidth | ||
real(kind=wp), | intent(in), | optional | :: | vmin | ||
real(kind=wp), | intent(in), | optional | :: | vmax | ||
character(len=*), | intent(in), | optional | :: | label | ||
logical, | intent(in), | optional | :: | show_colorbar |
Create a grid of subplots
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | nrows | |||
integer, | intent(in) | :: | ncols |
Add a plot to a specific subplot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | row | |||
integer, | intent(in) | :: | col | |||
real(kind=wp), | intent(in) | :: | x(:) | |||
real(kind=wp), | intent(in) | :: | y(:) | |||
character(len=*), | intent(in), | optional | :: | label | ||
character(len=*), | intent(in), | optional | :: | linestyle | ||
real(kind=wp), | intent(in), | optional | :: | color(3) |
Get the number of plots in a specific subplot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self | |||
integer, | intent(in) | :: | row | |||
integer, | intent(in) | :: | col |
Set the title for a specific subplot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | row | |||
integer, | intent(in) | :: | col | |||
character(len=*), | intent(in) | :: | title |
Set the x-axis label for a specific subplot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | row | |||
integer, | intent(in) | :: | col | |||
character(len=*), | intent(in) | :: | xlabel |
Set the y-axis label for a specific subplot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | row | |||
integer, | intent(in) | :: | col | |||
character(len=*), | intent(in) | :: | ylabel |
Get the title for a specific subplot
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self | |||
integer, | intent(in) | :: | row | |||
integer, | intent(in) | :: | col |
Get figure width
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |
Get figure height
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |
Get rendered state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |
Set rendered state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
logical, | intent(in) | :: | rendered |
Get number of plots
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |
Get pointer to plots array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in), | target | :: | self |
Setup PNG backend for animation (temporary method)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self |
Extract RGB data for animation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(out) | :: | rgb_data(:,:,:) |
Extract PNG data for animation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
integer(kind=1), | intent(out), | allocatable | :: | png_data(:) | ||
integer, | intent(out) | :: | status |
Set backend color
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | r | |||
real(kind=wp), | intent(in) | :: | g | |||
real(kind=wp), | intent(in) | :: | b |
Draw line using backend
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(inout) | :: | self | |||
real(kind=wp), | intent(in) | :: | x1 | |||
real(kind=wp), | intent(in) | :: | y1 | |||
real(kind=wp), | intent(in) | :: | x2 | |||
real(kind=wp), | intent(in) | :: | y2 |
Check if backend is allocated
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |
Get x minimum value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |
Get x maximum value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |
Get y minimum value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |
Get y maximum value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(figure_t), | intent(in) | :: | self |