fortplot_ascii_secondary_axes Module

ASCII backend secondary axis rendering

Handles twin-axes tick labels for the ASCII backend. Separated from the rendering pipeline to keep module size compliant.

Secondary labels are placed in reserved bands outside the primary data area: the secondary y-axis labels go in the right-hand columns beyond the data plot area, and the secondary x-axis (top) labels go in the reserved rows above it (issue #2066). The reservation itself shrinks the ASCII plot area before data is drawn, so labels never overwrite plotted glyphs or the axis spines.



Functions

public function ascii_secondary_y_tick_width(yscale, symlog_threshold, y_min, y_max, date_format) result(width)

Width in character cells needed to hold the widest secondary y tick label, plus one column of padding from the data area. Used to reserve the right-hand band before data is drawn.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
character(len=*), intent(in), optional :: date_format

Return Value integer


Subroutines

public subroutine ascii_draw_secondary_x_axis_top(backend, xscale, symlog_threshold, x_min, x_max, xlabel, date_format)

Draw top x-axis tick labels for ASCII backend in the reserved top band

Arguments

Type IntentOptional Attributes Name
type(ascii_context), intent(inout) :: backend
character(len=*), intent(in) :: xscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
character(len=:), intent(in), optional, allocatable :: xlabel
character(len=*), intent(in), optional :: date_format

public subroutine ascii_draw_secondary_y_axis(backend, yscale, symlog_threshold, y_min, y_max, ylabel, date_format)

Draw right y-axis tick labels for ASCII backend in the reserved band to the right of the primary data area.

Arguments

Type IntentOptional Attributes Name
type(ascii_context), intent(inout) :: backend
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
character(len=:), intent(in), optional, allocatable :: ylabel
character(len=*), intent(in), optional :: date_format