fortplot_raster_labels Module

Raster axis labels (title, xlabel, ylabel) rendering functionality Extracted from fortplot_raster_axes.f90 for single responsibility principle



Functions

public function y_tick_label_right_edge_at_axis(plot_area, max_width_measured)

Compute the rightmost edge of y-tick labels relative to the y-axis

Arguments

Type IntentOptional Attributes Name
type(plot_area_t), intent(in) :: plot_area
integer, intent(in) :: max_width_measured

Return Value integer

public function compute_ylabel_x_pos(y_tick_label_edge, rotated_width, plot_area)

Compute x-position for ylabel to avoid overlapping with y-tick labels

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: y_tick_label_edge
integer, intent(in) :: rotated_width
type(plot_area_t), intent(in) :: plot_area

Return Value integer


Subroutines

public subroutine raster_draw_axis_labels(raster, width, height, plot_area, title, xlabel, ylabel)

Draw all axis labels (title, xlabel, ylabel)

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) :: title
character(len=*), intent(in) :: xlabel
character(len=*), intent(in) :: ylabel

public subroutine raster_render_ylabel(raster, width, height, plot_area, ylabel)

Render rotated ylabel to the left of y-axis

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) :: ylabel

public subroutine raster_render_ylabel_right(raster, width, height, plot_area, ylabel)

Render rotated ylabel along the right side of the axis

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) :: ylabel

public subroutine raster_draw_top_xlabel(raster, width, height, plot_area, xlabel)

Render an xlabel centered above the plot area

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) :: xlabel

public subroutine render_title_centered(raster, width, height, plot_area, title_text)

Render title centered above the plot area

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) :: title_text

public subroutine compute_title_position(plot_area, title_text, processed_text, processed_len, escaped_text, title_px, title_py)

Compute the position for centered title above plot area

Arguments

Type IntentOptional Attributes Name
type(plot_area_t), intent(in) :: plot_area
character(len=*), intent(in) :: title_text
character(len=*), intent(out) :: processed_text
integer, intent(out) :: processed_len
character(len=*), intent(out) :: escaped_text
real(kind=wp), intent(out) :: title_px
real(kind=wp), intent(out) :: title_py