fortplot_figure_core_operations Module

Core operations implementations extracted from fortplot_figure_core

This module contains the actual implementations of core figure operations that were previously inline procedures in the main core module.

EXTRACTED OPERATIONS: - initialize: Figure initialization with backend setup - add_plot: Basic line plotting functionality
- add_contour: Contour plot creation - add_contour_filled: Filled contour plots - add_pcolormesh: Pseudocolor mesh plotting - streamplot: Streamline visualization - savefig variants: File output operations - show: Figure display operations



Subroutines

public subroutine core_initialize(state, plots, streamlines, subplots_array, subplot_rows, subplot_cols, current_subplot, title, xlabel, ylabel, plot_count, width, height, backend)

Arguments

Type IntentOptional Attributes Name
type(figure_state_t), intent(inout) :: state
type(plot_data_t), intent(inout), allocatable :: plots(:)
type(plot_data_t), intent(inout), allocatable :: streamlines(:)
type(subplot_data_t), intent(inout), allocatable :: subplots_array(:,:)
integer, intent(inout) :: subplot_rows
integer, intent(inout) :: subplot_cols
integer, intent(inout) :: current_subplot
character(len=:), intent(inout), allocatable :: title
character(len=:), intent(inout), allocatable :: xlabel
character(len=:), intent(inout), allocatable :: ylabel
integer, intent(inout) :: plot_count
integer, intent(in), optional :: width
integer, intent(in), optional :: height
character(len=*), intent(in), optional :: backend

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

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout), allocatable :: 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)
integer, intent(inout) :: plot_count

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

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout), allocatable :: 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
integer, intent(inout) :: plot_count

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

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout), allocatable :: 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
integer, intent(inout) :: plot_count

public subroutine core_add_surface(plots, state, x_grid, y_grid, z_grid, label, colormap, show_colorbar, alpha, edgecolor, linewidth, plot_count)

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout), allocatable :: 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
integer, intent(inout) :: plot_count

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

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout), allocatable :: 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
integer, intent(inout) :: plot_count

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

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout), allocatable :: 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
integer, intent(inout) :: plot_count

public subroutine core_add_pie(plots, state, values, labels, autopct, startangle, colors, explode, plot_count)

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout), allocatable :: plots(:)
type(figure_state_t), intent(inout) :: state
real(kind=wp), intent(in) :: values(:)
character(len=*), intent(in), optional :: labels(:)
character(len=*), intent(in), optional :: autopct
real(kind=wp), intent(in), optional :: startangle
character(len=*), intent(in), optional :: colors(:)
real(kind=wp), intent(in), optional :: explode(:)
integer, intent(inout) :: plot_count

public subroutine core_streamplot(plots, state, plot_count, x, y, u, v, density, color)

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(inout), allocatable :: plots(:)
type(figure_state_t), intent(inout) :: state
integer, intent(inout) :: plot_count
real(kind=wp), intent(in) :: x(:)
real(kind=wp), intent(in) :: y(:)
real(kind=wp), intent(in) :: u(:,:)
real(kind=wp), intent(in) :: v(:,:)
real(kind=wp), intent(in), optional :: density
real(kind=wp), intent(in), optional :: color(3)

public subroutine core_savefig(state, plots, plot_count, filename, blocking, annotations, annotation_count, subplots_array, subplot_rows, subplot_cols)

Arguments

Type IntentOptional Attributes Name
type(figure_state_t), intent(inout) :: state
type(plot_data_t), intent(inout), allocatable :: plots(:)
integer, intent(in) :: plot_count
character(len=*), intent(in) :: filename
logical, intent(in), optional :: blocking
type(text_annotation_t), intent(inout), allocatable :: annotations(:)
integer, intent(in) :: annotation_count
type(subplot_data_t), intent(in), optional :: subplots_array(:,:)
integer, intent(in), optional :: subplot_rows
integer, intent(in), optional :: subplot_cols

public subroutine core_savefig_with_status(state, plots, plot_count, filename, status, blocking, annotations, annotation_count, subplots_array, subplot_rows, subplot_cols)

Arguments

Type IntentOptional Attributes Name
type(figure_state_t), intent(inout) :: state
type(plot_data_t), intent(inout), allocatable :: plots(:)
integer, intent(in) :: plot_count
character(len=*), intent(in) :: filename
integer, intent(out) :: status
logical, intent(in), optional :: blocking
type(text_annotation_t), intent(inout), allocatable :: annotations(:)
integer, intent(in) :: annotation_count
type(subplot_data_t), intent(in), optional :: subplots_array(:,:)
integer, intent(in), optional :: subplot_rows
integer, intent(in), optional :: subplot_cols

public subroutine core_show(state, plots, plot_count, blocking, annotations, annotation_count, subplots_array, subplot_rows, subplot_cols)

Arguments

Type IntentOptional Attributes Name
type(figure_state_t), intent(inout) :: state
type(plot_data_t), intent(inout), allocatable :: plots(:)
integer, intent(in) :: plot_count
logical, intent(in), optional :: blocking
type(text_annotation_t), intent(inout), allocatable :: annotations(:)
integer, intent(in) :: annotation_count
type(subplot_data_t), intent(in), optional :: subplots_array(:,:)
integer, intent(in), optional :: subplot_rows
integer, intent(in), optional :: subplot_cols