Figure plot data management module
Single Responsibility: Manage plot data storage and operations Extracted from fortplot_figure_core to improve modularity
Determine the next color from the figure palette using plot count
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(figure_state_t), | intent(in) | :: | state | 
Validate plot data and provide informative warnings for edge cases Added for Issue #432: Better user feedback for problematic data Fixed Issue #833: Reduced warning verbosity for constant data
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x(:) | |||
| real(kind=wp), | intent(in) | :: | y(:) | |||
| character(len=*), | intent(in), | optional | :: | label | 
Add line plot data to internal storage with edge case validation Fixed Issue #432: Added data validation for better user feedback
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| integer, | intent(inout) | :: | plot_count | |||
| integer, | intent(in) | :: | max_plots | |||
| 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) | :: | color(3) | |||
| character(len=*), | intent(in), | optional | :: | marker | 
Store a fill_between polygon for rendering
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| integer, | intent(inout) | :: | plot_count | |||
| integer, | intent(in) | :: | max_plots | |||
| real(kind=wp), | intent(in) | :: | x(:) | |||
| real(kind=wp), | intent(in) | :: | upper(:) | |||
| real(kind=wp), | intent(in) | :: | lower(:) | |||
| logical, | intent(in), | optional | :: | mask(:) | ||
| real(kind=wp), | intent(in) | :: | color(3) | |||
| real(kind=wp), | intent(in), | optional | :: | alpha | 
Add contour plot data to internal storage
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| integer, | intent(inout) | :: | plot_count | |||
| integer, | intent(in) | :: | max_plots | |||
| real(kind=wp), | intent(in) | :: | colors(:,:) | |||
| 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 colored contour plot data
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| integer, | intent(inout) | :: | plot_count | |||
| integer, | intent(in) | :: | max_plots | |||
| 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 3D surface plot data using structured grid storage
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| integer, | intent(inout) | :: | plot_count | |||
| integer, | intent(in) | :: | max_plots | |||
| real(kind=wp), | intent(in) | :: | colors(:,:) | |||
| real(kind=wp), | intent(in) | :: | x_grid(:) | |||
| real(kind=wp), | intent(in) | :: | y_grid(:) | |||
| real(kind=wp), | intent(in) | :: | z_grid(:,:) | |||
| character(len=*), | intent(in), | optional | :: | label | ||
| character(len=*), | intent(in), | optional | :: | colormap | ||
| logical, | intent(in), | optional | :: | show_colorbar | ||
| real(kind=wp), | intent(in), | optional | :: | alpha | ||
| real(kind=wp), | intent(in), | optional | :: | edgecolor(3) | ||
| real(kind=wp), | intent(in), | optional | :: | linewidth | 
Add pcolormesh plot data
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| integer, | intent(inout) | :: | plot_count | |||
| integer, | intent(in) | :: | max_plots | |||
| 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 | 
Generate default contour levels
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plot_data | 
Setup figure legend
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(legend_t), | intent(inout) | :: | legend_data | |||
| logical, | intent(inout) | :: | show_legend | |||
| type(plot_data_t), | intent(in) | :: | plots(:) | |||
| integer, | intent(in) | :: | plot_count | |||
| character(len=*), | intent(in), | optional | :: | location | ||
| character(len=*), | intent(in), | optional | :: | backend_name | 
Update y data for an existing plot
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| integer, | intent(in) | :: | plot_count | |||
| integer, | intent(in) | :: | plot_index | |||
| real(kind=wp), | intent(in) | :: | y_new(:) |