fortplot_pdf_axes Module

PDF axes, grid, and tick drawing operations Handles plot frame, axes, tick marks, and grid lines



Subroutines

public subroutine setup_axes_data_ranges(ctx, x_min_orig, x_max_orig, y_min_orig, y_max_orig, x_min_adj, x_max_adj, y_min_adj, y_max_adj, xscale, yscale)

Set up data ranges for axes with optional log scaling

Arguments

Type IntentOptional Attributes Name
type(pdf_context_core), intent(inout) :: ctx
real(kind=wp), intent(in) :: x_min_orig
real(kind=wp), intent(in) :: x_max_orig
real(kind=wp), intent(in) :: y_min_orig
real(kind=wp), intent(in) :: y_max_orig
real(kind=wp), intent(out) :: x_min_adj
real(kind=wp), intent(out) :: x_max_adj
real(kind=wp), intent(out) :: y_min_adj
real(kind=wp), intent(out) :: y_max_adj
character(len=*), intent(in), optional :: xscale
character(len=*), intent(in), optional :: yscale

public subroutine generate_tick_data(ctx, data_x_min, data_x_max, data_y_min, data_y_max, x_positions, y_positions, x_labels, y_labels, num_x_ticks, num_y_ticks, xscale, yscale, plot_area_left, plot_area_bottom, plot_area_width, plot_area_height)

Generate tick positions and labels for axes Refactored to be under 100 lines (QADS compliance)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_core), intent(in) :: ctx
real(kind=wp), intent(in) :: data_x_min
real(kind=wp), intent(in) :: data_x_max
real(kind=wp), intent(in) :: data_y_min
real(kind=wp), intent(in) :: data_y_max
real(kind=wp), intent(out), allocatable :: x_positions(:)
real(kind=wp), intent(out), allocatable :: y_positions(:)
character(len=32), intent(out), allocatable :: x_labels(:)
character(len=32), intent(out), allocatable :: y_labels(:)
integer, intent(out) :: num_x_ticks
integer, intent(out) :: num_y_ticks
character(len=*), intent(in), optional :: xscale
character(len=*), intent(in), optional :: yscale
real(kind=wp), intent(in) :: plot_area_left
real(kind=wp), intent(in) :: plot_area_bottom
real(kind=wp), intent(in) :: plot_area_width
real(kind=wp), intent(in) :: plot_area_height

public subroutine draw_pdf_axes_and_labels(ctx, xscale, yscale, symlog_threshold, data_x_min, data_x_max, data_y_min, data_y_max, title, xlabel, ylabel, plot_area_left, plot_area_bottom, plot_area_width, plot_area_height, canvas_height)

Draw complete axes system with labels using actual plot area coordinates

Arguments

Type IntentOptional Attributes Name
type(pdf_context_core), intent(inout) :: ctx
character(len=*), intent(in), optional :: xscale
character(len=*), intent(in), optional :: yscale
real(kind=wp), intent(in), optional :: symlog_threshold
real(kind=wp), intent(in) :: data_x_min
real(kind=wp), intent(in) :: data_x_max
real(kind=wp), intent(in) :: data_y_min
real(kind=wp), intent(in) :: data_y_max
character(len=*), intent(in), optional :: title
character(len=*), intent(in), optional :: xlabel
character(len=*), intent(in), optional :: ylabel
real(kind=wp), intent(in) :: plot_area_left
real(kind=wp), intent(in) :: plot_area_bottom
real(kind=wp), intent(in) :: plot_area_width
real(kind=wp), intent(in) :: plot_area_height
real(kind=wp), intent(in) :: canvas_height

public subroutine draw_pdf_3d_axes_frame(ctx, x_min, x_max, y_min, y_max, z_min, z_max)

Draw 3D axes frame - see issue #494 for implementation roadmap

Arguments

Type IntentOptional Attributes Name
type(pdf_context_core), intent(inout) :: ctx
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
real(kind=wp), intent(in) :: z_min
real(kind=wp), intent(in) :: z_max

public subroutine draw_pdf_frame_with_area(ctx, plot_left, plot_bottom, plot_width, plot_height, canvas_height)

Draw the plot frame using actual plot area coordinates (FIXED version)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_core), intent(inout) :: ctx
real(kind=wp), intent(in) :: plot_left
real(kind=wp), intent(in) :: plot_bottom
real(kind=wp), intent(in) :: plot_width
real(kind=wp), intent(in) :: plot_height
real(kind=wp), intent(in) :: canvas_height

public subroutine draw_pdf_tick_marks_with_area(ctx, x_positions, y_positions, num_x, num_y, plot_left, plot_bottom, canvas_height)

Draw tick marks using actual plot area coordinates (FIXED version)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_core), intent(inout) :: ctx
real(kind=wp), intent(in) :: x_positions(:)
real(kind=wp), intent(in) :: y_positions(:)
integer, intent(in) :: num_x
integer, intent(in) :: num_y
real(kind=wp), intent(in) :: plot_left
real(kind=wp), intent(in) :: plot_bottom
real(kind=wp), intent(in) :: canvas_height

public subroutine draw_pdf_tick_labels_with_area(ctx, x_positions, y_positions, x_labels, y_labels, num_x, num_y, plot_left, plot_bottom, canvas_height)

Draw tick labels using actual plot area coordinates (FIXED version)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_core), intent(inout) :: ctx
real(kind=wp), intent(in) :: x_positions(:)
real(kind=wp), intent(in) :: y_positions(:)
character(len=*), intent(in) :: x_labels(:)
character(len=*), intent(in) :: y_labels(:)
integer, intent(in) :: num_x
integer, intent(in) :: num_y
real(kind=wp), intent(in) :: plot_left
real(kind=wp), intent(in) :: plot_bottom
real(kind=wp), intent(in) :: canvas_height

public subroutine draw_pdf_title_and_labels(ctx, title, xlabel, ylabel, plot_area_left, plot_area_bottom, plot_area_width, plot_area_height)

Draw plot title and axis labels

Arguments

Type IntentOptional Attributes Name
type(pdf_context_core), intent(inout) :: ctx
character(len=*), intent(in), optional :: title
character(len=*), intent(in), optional :: xlabel
character(len=*), intent(in), optional :: ylabel
real(kind=wp), intent(in) :: plot_area_left
real(kind=wp), intent(in) :: plot_area_bottom
real(kind=wp), intent(in) :: plot_area_width
real(kind=wp), intent(in) :: plot_area_height