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)



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) :: 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)

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) :: 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

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

Add a filled contour plot with color mapping

Arguments

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

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

Add a pcolormesh plot

Arguments

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