fortplot_pdf_axes_tick_data Module

PDF axis tick data generation module

Handles tick position calculation, label formatting, and subsampling. Pure computation module - no PDF context dependency.



Subroutines

public subroutine initialize_tick_arrays(plot_width, plot_height, num_x_ticks, num_y_ticks, x_positions, y_positions, x_labels, y_labels)

Initialize tick count and allocate arrays

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: plot_width
real(kind=wp), intent(in) :: plot_height
integer, intent(out) :: num_x_ticks
integer, intent(out) :: num_y_ticks
real(kind=wp), intent(out), allocatable :: x_positions(:)
real(kind=wp), intent(out), allocatable :: y_positions(:)
character(len=50), intent(out), allocatable :: x_labels(:)
character(len=50), intent(out), allocatable :: y_labels(:)

public subroutine generate_x_axis_ticks(data_min, data_max, num_ticks, plot_left, plot_width, positions, labels, scale_type, date_format, symlog_threshold, custom_xticks, custom_xtick_labels)

Generate X axis tick positions and labels

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: data_min
real(kind=wp), intent(in) :: data_max
integer, intent(inout) :: num_ticks
real(kind=wp), intent(in) :: plot_left
real(kind=wp), intent(in) :: plot_width
real(kind=wp), intent(out) :: positions(:)
character(len=50), intent(out) :: labels(:)
character(len=*), intent(in), optional :: scale_type
character(len=*), intent(in), optional :: date_format
real(kind=wp), intent(in), optional :: symlog_threshold
real(kind=wp), intent(in), optional :: custom_xticks(:)
character(len=*), intent(in), optional :: custom_xtick_labels(:)

public subroutine generate_y_axis_ticks(data_min, data_max, num_ticks, plot_bottom, plot_height, positions, labels, scale_type, date_format, symlog_threshold, custom_yticks, custom_ytick_labels)

Generate Y axis tick positions and labels

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: data_min
real(kind=wp), intent(in) :: data_max
integer, intent(inout) :: num_ticks
real(kind=wp), intent(in) :: plot_bottom
real(kind=wp), intent(in) :: plot_height
real(kind=wp), intent(out) :: positions(:)
character(len=50), intent(out) :: labels(:)
character(len=*), intent(in), optional :: scale_type
character(len=*), intent(in), optional :: date_format
real(kind=wp), intent(in), optional :: symlog_threshold
real(kind=wp), intent(in), optional :: custom_yticks(:)
character(len=*), intent(in), optional :: custom_ytick_labels(:)

public subroutine apply_custom_axis_ticks(axis, custom_xticks, custom_xtick_labels, custom_yticks, custom_ytick_labels, data_min, data_max, plot_start, plot_size, num_ticks, positions, labels, scale_type, symlog_threshold)

Apply custom tick positions/labels, converting data coords to plot area coords

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(in) :: axis
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(:)
real(kind=wp), intent(in) :: data_min
real(kind=wp), intent(in) :: data_max
real(kind=wp), intent(in) :: plot_start
real(kind=wp), intent(in) :: plot_size
integer, intent(inout) :: num_ticks
real(kind=wp), intent(out) :: positions(:)
character(len=50), intent(out) :: labels(:)
character(len=*), intent(in), optional :: scale_type
real(kind=wp), intent(in), optional :: symlog_threshold

public subroutine generate_axis_ticks_internal(data_min, data_max, num_ticks, plot_start, plot_size, positions, labels, scale_type, date_format, symlog_threshold, axis, custom_xticks, custom_xtick_labels, custom_yticks, custom_ytick_labels)

Internal helper to generate axis tick positions and labels

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: data_min
real(kind=wp), intent(in) :: data_max
integer, intent(inout) :: num_ticks
real(kind=wp), intent(in) :: plot_start
real(kind=wp), intent(in) :: plot_size
real(kind=wp), intent(out) :: positions(:)
character(len=50), intent(out) :: labels(:)
character(len=*), intent(in), optional :: scale_type
character(len=*), intent(in), optional :: date_format
real(kind=wp), intent(in), optional :: symlog_threshold
character(len=1), intent(in) :: axis
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(:)

public subroutine subsample_ticks(tvals, nt, max_ticks, scale, threshold)

Subsample ticks in transformed coordinate space for proportional visual spacing.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout), contiguous :: tvals(:)
integer, intent(in) :: nt
integer, intent(in) :: max_ticks
character(len=*), intent(in) :: scale
real(kind=wp), intent(in) :: threshold

public subroutine fill_tick_positions_and_labels(tvals, nt, data_min, data_max, plot_start, plot_size, num_ticks, positions, labels, scale, threshold, date_format)

Fill tick positions and labels arrays

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: tvals(:)
integer, intent(in) :: nt
real(kind=wp), intent(in) :: data_min
real(kind=wp), intent(in) :: data_max
real(kind=wp), intent(in) :: plot_start
real(kind=wp), intent(in) :: plot_size
integer, intent(in) :: num_ticks
real(kind=wp), intent(out) :: positions(:)
character(len=50), intent(out) :: labels(:)
character(len=*), intent(in) :: scale
real(kind=wp), intent(in) :: threshold
character(len=*), intent(in), optional :: date_format

public subroutine handle_zero_range_ticks(data_value, num_ticks, center_position, positions, labels, scale_type, date_format)

Handle ticks for zero or near-zero range data

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: data_value
integer, intent(in) :: num_ticks
real(kind=wp), intent(in) :: center_position
real(kind=wp), intent(out) :: positions(:)
character(len=50), intent(out) :: labels(:)
character(len=*), intent(in), optional :: scale_type
character(len=*), intent(in), optional :: date_format