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, fill_between) Pie chart functionality is in fortplot_figure_pie.
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), | contiguous | :: | x(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | 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), | contiguous | :: | x_grid(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | y_grid(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | 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), | contiguous | :: | x_grid(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | y_grid(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | z_grid(:,:) | ||
| real(kind=wp), | intent(in), | optional | :: | levels(:) | ||
| character(len=*), | intent(in), | optional | :: | cmap | ||
| logical, | intent(in), | optional | :: | show_colorbar | ||
| character(len=*), | intent(in), | optional | :: | label | ||
| character(len=*), | intent(in), | optional | :: | colormap |
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), | contiguous | :: | x_grid(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | y_grid(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | z_grid(:,:) | ||
| character(len=*), | intent(in), | optional | :: | label | ||
| character(len=*), | intent(in), | optional | :: | cmap | ||
| 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 | ||
| logical, | intent(in), | optional | :: | filled | ||
| character(len=*), | intent(in), | optional | :: | colormap |
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), | contiguous | :: | x(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | y(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | c(:,:) | ||
| character(len=*), | intent(in), | optional | :: | cmap | ||
| 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 | ||
| character(len=*), | intent(in), | optional | :: | colormap |
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), | contiguous | :: | x(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | upper(:) | ||
| real(kind=wp), | intent(in), | contiguous | :: | lower(:) | ||
| logical, | intent(in), | optional | :: | mask(:) | ||
| character(len=*), | intent(in), | optional | :: | color_string | ||
| real(kind=wp), | intent(in), | optional | :: | alpha |