fortplot_figure_rendering_pipeline Module

Figure rendering pipeline module

Single Responsibility: Coordinate the complete rendering pipeline Extracted from fortplot_figure_core to improve modularity



Subroutines

public subroutine setup_coordinate_system(backend, x_min_transformed, x_max_transformed, y_min_transformed, y_max_transformed, sticky_x_min, sticky_x_max, sticky_y_min, sticky_y_max)

Setup the coordinate system for rendering The transformed bounds passed here already include any autoscale margin from calculate_figure_data_ranges, so this routine just hands them to the backend.

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend
real(kind=wp), intent(in) :: x_min_transformed
real(kind=wp), intent(in) :: x_max_transformed
real(kind=wp), intent(in) :: y_min_transformed
real(kind=wp), intent(in) :: y_max_transformed
logical, intent(in), optional :: sticky_x_min
logical, intent(in), optional :: sticky_x_max
logical, intent(in), optional :: sticky_y_min
logical, intent(in), optional :: sticky_y_max

public subroutine expand_data_range(data_min, data_max, expanded_min, expanded_max, sticky_min, sticky_max)

Expand a data range by DATA_RANGE_MARGIN (5%) of the span on each side, matching matplotlib's default axes margin (rcParams axes.{x,y}margin = 0.05). Also keeps markers at exact boundaries clear of the plot frame stroke.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: data_min
real(kind=wp), intent(in) :: data_max
real(kind=wp), intent(out) :: expanded_min
real(kind=wp), intent(out) :: expanded_max
logical, intent(in), optional :: sticky_min
logical, intent(in), optional :: sticky_max

public subroutine render_figure_background(backend)

Render figure background

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend

public subroutine render_figure_axes(backend, xscale, yscale, symlog_threshold, x_min, x_max, y_min, y_max, title, xlabel, ylabel, plots, plot_count, has_twinx, twinx_y_min, twinx_y_max, twinx_ylabel, twinx_yscale, has_twiny, twiny_x_min, twiny_x_max, twiny_xlabel, twiny_xscale, state)

Render figure axes and labels For raster backends, split rendering to prevent label overlap issues

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend
character(len=*), intent(in) :: xscale
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
character(len=:), intent(in), allocatable :: title
character(len=:), intent(in), allocatable :: xlabel
character(len=:), intent(in), allocatable :: ylabel
type(plot_data_t), intent(in) :: plots(:)
integer, intent(in) :: plot_count
logical, intent(in), optional :: has_twinx
real(kind=wp), intent(in), optional :: twinx_y_min
real(kind=wp), intent(in), optional :: twinx_y_max
character(len=:), intent(in), optional, allocatable :: twinx_ylabel
character(len=*), intent(in), optional :: twinx_yscale
logical, intent(in), optional :: has_twiny
real(kind=wp), intent(in), optional :: twiny_x_min
real(kind=wp), intent(in), optional :: twiny_x_max
character(len=:), intent(in), optional, allocatable :: twiny_xlabel
character(len=*), intent(in), optional :: twiny_xscale
type(figure_state_t), intent(in), optional :: state

public subroutine render_ascii_grid(backend, xscale, yscale, symlog_threshold, x_min, x_max, y_min, y_max, grid_axis, grid_which)

Paint text-backend grid glyphs aligned to major ticks after the data series so the layer policy keeps data on top of the grid (issue

Read more…

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend
character(len=*), intent(in) :: xscale
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
character(len=1), intent(in) :: grid_axis
character(len=*), intent(in) :: grid_which

public subroutine render_3d_front_frame(backend, plots, plot_count, x_min, x_max, y_min, y_max)

Draw the front box spines after the data for the 3D case so they occlude curves and surfaces (global painter ordering, refs #1956). Raster, PDF, and ASCII backends all carry the projected 3D box so the near spines occlude the data on every backend (refs #2054).

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend
type(plot_data_t), intent(in) :: plots(:)
integer, intent(in) :: plot_count
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max

public subroutine render_figure_axes_labels_only(backend, xscale, yscale, symlog_threshold, x_min, x_max, y_min, y_max, title, xlabel, ylabel, plots, plot_count, has_twinx, twinx_y_min, twinx_y_max, twinx_ylabel, twinx_yscale, has_twiny, twiny_x_min, twiny_x_max, twiny_xlabel, twiny_xscale, custom_xticks, custom_xtick_labels, custom_yticks, custom_ytick_labels, x_date_format, y_date_format, twinx_y_date_format, twiny_x_date_format)

Render ONLY axis labels (for raster and PDF backends after plots are drawn)

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend
character(len=*), intent(in) :: xscale
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
character(len=:), intent(in), allocatable :: title
character(len=:), intent(in), allocatable :: xlabel
character(len=:), intent(in), allocatable :: ylabel
type(plot_data_t), intent(in) :: plots(:)
integer, intent(in) :: plot_count
logical, intent(in), optional :: has_twinx
real(kind=wp), intent(in), optional :: twinx_y_min
real(kind=wp), intent(in), optional :: twinx_y_max
character(len=:), intent(in), optional, allocatable :: twinx_ylabel
character(len=*), intent(in), optional :: twinx_yscale
logical, intent(in), optional :: has_twiny
real(kind=wp), intent(in), optional :: twiny_x_min
real(kind=wp), intent(in), optional :: twiny_x_max
character(len=:), intent(in), optional, allocatable :: twiny_xlabel
character(len=*), intent(in), optional :: twiny_xscale
real(kind=wp), intent(in), optional :: custom_xticks(:)
character(len=*), intent(in), optional :: custom_xtick_labels(:)
real(kind=wp), intent(in), optional :: custom_yticks(:)
character(len=*), intent(in), optional :: custom_ytick_labels(:)
character(len=*), intent(in), optional :: x_date_format
character(len=*), intent(in), optional :: y_date_format
character(len=*), intent(in), optional :: twinx_y_date_format
character(len=*), intent(in), optional :: twiny_x_date_format

public subroutine render_title_only(backend, title, x_min, x_max, y_min, y_max, custom_title_font_size)

Render only the figure title without drawing axes

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend
character(len=:), intent(in), allocatable :: title
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
real(kind=wp), intent(in), optional :: custom_title_font_size