fortplot_figure_plots Module

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.



Subroutines

public subroutine figure_add_plot(plots, state, x, y, label, linestyle, color)

Add a line plot to the figure

Arguments

Type IntentOptional 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)

public subroutine figure_add_contour(plots, state, x_grid, y_grid, z_grid, levels, label)

Add a contour plot to the figure

Arguments

Type IntentOptional 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

public subroutine figure_add_contour_filled(plots, state, x_grid, y_grid, z_grid, levels, cmap, show_colorbar, label, colormap)

Add a filled contour plot with color mapping

Read more…

Arguments

Type IntentOptional 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

public subroutine figure_add_surface(plots, state, x_grid, y_grid, z_grid, label, cmap, show_colorbar, alpha, edgecolor, linewidth, filled, colormap)

Add a 3D surface plot to the figure

Read more…

Arguments

Type IntentOptional 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

public subroutine figure_add_pcolormesh(plots, state, x, y, c, cmap, vmin, vmax, edgecolors, linewidths, colormap)

Add a pcolormesh plot

Read more…

Arguments

Type IntentOptional 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

public subroutine figure_add_fill_between(plots, state, x, upper, lower, mask, color_string, alpha)

Add an area fill between two curves

Arguments

Type IntentOptional 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