fortplot_raster_ticks Module

Raster tick marks and tick labels rendering functionality Extracted from fortplot_raster_axes.f90 for single responsibility principle



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: X_TICK_LABEL_PAD = 20
integer, public, parameter :: Y_TICK_LABEL_RIGHT_PAD = 10
integer, public, parameter :: Y_TICK_LABEL_LEFT_PAD = 10
integer, public, parameter :: X_TICK_LABEL_TOP_PAD = 20
integer, public :: last_y_tick_max_width = 0
integer, public :: last_y_tick_max_width_right = 0
integer, public :: last_x_tick_max_height_top = 0

Subroutines

public subroutine raster_draw_x_axis_ticks(raster, width, height, plot_area, xscale, symlog_threshold, xticks, xtick_labels, xtick_colors, x_min, x_max)

Draw x-axis tick marks and labels

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: xscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: xticks(:)
character(len=*), intent(in) :: xtick_labels(:)
integer, intent(in) :: xtick_colors(:,:)
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max

public subroutine raster_draw_y_axis_ticks(raster, width, height, plot_area, yscale, symlog_threshold, yticks, ytick_labels, ytick_colors, y_min, y_max)

Draw y-axis tick marks and labels

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: yticks(:)
character(len=*), intent(in) :: ytick_labels(:)
integer, intent(in) :: ytick_colors(:,:)
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max

public subroutine raster_draw_x_axis_tick_marks_only(raster, width, height, plot_area, xscale, symlog_threshold, xticks, xtick_colors, x_min, x_max)

Draw only x-axis tick marks (no labels)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: xscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: xticks(:)
integer, intent(in) :: xtick_colors(:,:)
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max

public subroutine raster_draw_y_axis_tick_marks_only(raster, width, height, plot_area, yscale, symlog_threshold, yticks, ytick_colors, y_min, y_max)

Draw only y-axis tick marks (no labels)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: yticks(:)
integer, intent(in) :: ytick_colors(:,:)
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max

public subroutine raster_draw_x_axis_tick_labels_only(raster, width, height, plot_area, xscale, symlog_threshold, xticks, xtick_labels, x_min, x_max)

Draw only x-axis tick labels (no marks)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: xscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: xticks(:)
character(len=*), intent(in) :: xtick_labels(:)
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max

public subroutine raster_draw_y_axis_tick_labels_only(raster, width, height, plot_area, yscale, symlog_threshold, yticks, ytick_labels, y_min, y_max)

Draw only y-axis tick labels (no marks)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: yticks(:)
character(len=*), intent(in) :: ytick_labels(:)
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max

public subroutine raster_draw_y_axis_ticks_right(raster, width, height, plot_area, yscale, symlog_threshold, yticks, ytick_labels, ytick_colors, y_min, y_max)

Draw y-axis tick marks and labels along the right side

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: yticks(:)
character(len=*), intent(in) :: ytick_labels(:)
integer, intent(in) :: ytick_colors(:,:)
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max

public subroutine raster_draw_y_axis_tick_marks_only_right(raster, width, height, plot_area, yscale, symlog_threshold, yticks, ytick_colors, y_min, y_max)

Draw y-axis tick marks on the right side (no labels)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: yticks(:)
integer, intent(in) :: ytick_colors(:,:)
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max

public subroutine raster_draw_y_axis_tick_labels_only_right(raster, width, height, plot_area, yscale, symlog_threshold, yticks, ytick_labels, y_min, y_max)

Draw y-axis tick labels on the right side (no marks)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: yticks(:)
character(len=*), intent(in) :: ytick_labels(:)
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max

public subroutine raster_draw_x_axis_ticks_top(raster, width, height, plot_area, xscale, symlog_threshold, xticks, xtick_labels, xtick_colors, x_min, x_max)

Draw x-axis tick marks and labels along the top side

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: xscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: xticks(:)
character(len=*), intent(in) :: xtick_labels(:)
integer, intent(in) :: xtick_colors(:,:)
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max

public subroutine raster_draw_x_axis_tick_marks_only_top(raster, width, height, plot_area, xscale, symlog_threshold, xticks, xtick_colors, x_min, x_max)

Draw x-axis tick marks on the top side (no labels)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: xscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: xticks(:)
integer, intent(in) :: xtick_colors(:,:)
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max

public subroutine raster_draw_x_axis_tick_labels_only_top(raster, width, height, plot_area, xscale, symlog_threshold, xticks, xtick_labels, x_min, x_max)

Draw x-axis tick labels on the top side (no marks)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: xscale
real(kind=wp), intent(in) :: symlog_threshold
real(kind=wp), intent(in) :: xticks(:)
character(len=*), intent(in) :: xtick_labels(:)
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max

public subroutine compute_non_overlapping_mask(xticks, xtick_labels, x_min, x_max, xscale, symlog_threshold, plot_area, visibility_mask)

Compute which x-axis tick labels can be drawn without overlapping Always shows first and last labels, hides overlapping ones in between

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xticks(:)
character(len=*), intent(in) :: xtick_labels(:)
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
character(len=*), intent(in) :: xscale
real(kind=wp), intent(in) :: symlog_threshold
type(plot_area_t), intent(in) :: plot_area
logical, intent(out) :: visibility_mask(size(xticks))