Plot creation methods for figure_t
This module contains the core plot creation functionality extracted from fortplot_figure_core to achieve QADS compliance (<500 lines).
Single Responsibility: Handle creation of different plot types (line plots, contours, filled contours, pcolormesh)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public, | parameter | :: | PI | = | acos(-1.0_wp) | 
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | slice_count | = | 0 | ||
| real(kind=wp), | public | :: | total | = | 0.0_wp | ||
| integer, | public, | allocatable | :: | indices(:) | |||
| real(kind=wp), | public, | allocatable | :: | explode(:) | |||
| logical, | public | :: | valid | = | .false. | 
Add a line plot to the figure
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| type(figure_state_t), | intent(inout) | :: | state | |||
| 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 | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| type(figure_state_t), | intent(inout) | :: | state | |||
| 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 | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| type(figure_state_t), | intent(inout) | :: | state | |||
| 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 3D surface plot to the figure
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| type(figure_state_t), | intent(inout) | :: | state | |||
| 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 a pcolormesh plot
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| type(figure_state_t), | intent(inout) | :: | state | |||
| 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 an area fill between two curves
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| type(figure_state_t), | intent(inout) | :: | state | |||
| real(kind=wp), | intent(in) | :: | x(:) | |||
| real(kind=wp), | intent(in) | :: | upper(:) | |||
| real(kind=wp), | intent(in) | :: | lower(:) | |||
| logical, | intent(in), | optional | :: | mask(:) | ||
| character(len=*), | intent(in), | optional | :: | color_string | ||
| real(kind=wp), | intent(in), | optional | :: | alpha | 
Store pie chart slices using polar wedges with optional explode & colors
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(inout) | :: | plots(:) | |||
| type(figure_state_t), | intent(inout) | :: | state | |||
| real(kind=wp), | intent(in) | :: | values(:) | |||
| character(len=*), | intent(in), | optional | :: | labels(:) | ||
| real(kind=wp), | intent(in), | optional | :: | startangle | ||
| character(len=*), | intent(in), | optional | :: | color_strings(:) | ||
| real(kind=wp), | intent(in), | optional | :: | explode(:) | ||
| character(len=*), | intent(in), | optional | :: | autopct |