fortplot_figure_plot_management Module

Figure plot data management module

Single Responsibility: Manage plot data storage and operations Extracted from fortplot_figure_core to improve modularity



Subroutines

public subroutine validate_plot_data(x, y, label)

Validate plot data and provide informative warnings for edge cases Added for Issue #432: Better user feedback for problematic data

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x(:)
real(kind=wp), intent(in) :: y(:)
character(len=*), intent(in), optional :: label

public subroutine add_line_plot_data(plots, plot_count, max_plots, colors, x, y, label, linestyle, color, marker)

Add line plot data to internal storage with edge case validation Fixed Issue #432: Added data validation for better user feedback

Arguments

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

public subroutine add_contour_plot_data(plots, plot_count, max_plots, colors, x_grid, y_grid, z_grid, levels, label)

Add contour plot data to internal storage

Arguments

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

public subroutine add_colored_contour_plot_data(plots, plot_count, max_plots, x_grid, y_grid, z_grid, levels, colormap, show_colorbar, label)

Add colored contour plot data

Arguments

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

public subroutine add_pcolormesh_plot_data(plots, plot_count, max_plots, x, y, c, colormap, vmin, vmax, edgecolors, linewidths)

Add pcolormesh plot data

Arguments

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

public subroutine generate_default_contour_levels(plot_data)

Generate default contour levels

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout) :: plot_data

public subroutine setup_figure_legend(legend_data, show_legend, plots, plot_count, location)

Setup figure legend

Arguments

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

public subroutine update_plot_ydata(plots, plot_count, plot_index, y_new)

Update y data for an existing plot

Arguments

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