Figure rendering pipeline module
Single Responsibility: Coordinate the complete rendering pipeline Extracted from fortplot_figure_core to improve modularity
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.
| Type | Intent | Optional | 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 |
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.
| Type | Intent | Optional | 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 |
Render figure background
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(plot_context), | intent(inout) | :: | backend |
Render figure axes and labels For raster backends, split rendering to prevent label overlap issues
| Type | Intent | Optional | 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 |
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
| Type | Intent | Optional | 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 |
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).
| Type | Intent | Optional | 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 |
Render ONLY axis labels (for raster and PDF backends after plots are drawn)
| Type | Intent | Optional | 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 |
Render only the figure title without drawing axes
| Type | Intent | Optional | 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 |