fortplot_subplot_colorbar Module

Per-axes colorbars inside subplot grids.

A panel colorbar is the single-axes colorbar applied to the panel's own axes box and mappables: the same config type, mappable resolution, area split and renderer. This module only adds the panel plumbing and the tight-layout estimate of the space its ticks and label need.



Derived Types

type, public ::  panel_colorbar_t

Resolved colorbar of one panel for one render pass

Components

Type Visibility Attributes Name Initial
logical, public :: active = .false.
type(colorbar_config_t), public :: cfg
integer, public :: mappable = 0
real(kind=wp), public :: vmin = 0.0_wp
real(kind=wp), public :: vmax = 1.0_wp
character(len=20), public :: cmap = 'viridis'
type(plot_area_t), public :: saved_area
type(plot_area_t), public :: bar_area

Subroutines

public subroutine begin_panel_colorbar(backend, sp, cb)

Split the panel's current axes box into axes and colorbar areas; the backend keeps the reduced axes box for the panel's plots.

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend
type(subplot_data_t), intent(in) :: sp
type(panel_colorbar_t), intent(out) :: cb

public subroutine render_panel_colorbar(backend, sp, cb, default_line_width)

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(inout) :: backend
type(subplot_data_t), intent(in) :: sp
type(panel_colorbar_t), intent(in) :: cb
real(kind=wp), intent(in) :: default_line_width

public subroutine panel_colorbar_tick_labels(sp, active, loc, labels, n, label, label_fontsize)

Tick labels (and axis label) the panel colorbar will draw, so a layout can reserve their extent before rendering.

Arguments

Type IntentOptional Attributes Name
type(subplot_data_t), intent(in) :: sp
logical, intent(out) :: active
character(len=10), intent(out) :: loc
character(len=50), intent(out) :: labels(40)
integer, intent(out) :: n
character(len=:), intent(out), allocatable :: label
real(kind=wp), intent(out) :: label_fontsize