fortplot_pdf_coordinate Module

PDF coordinate transformation and polymorphic method support Handles coordinate normalization and backend-specific method implementations



Derived Types

type, public ::  pdf_context_handle

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: x_min
real(kind=wp), public :: x_max
real(kind=wp), public :: y_min
real(kind=wp), public :: y_max
integer, public :: width
integer, public :: height
type(plot_area_t), public :: plot_area
type(pdf_context_core), public :: core_ctx

Functions

public function pdf_get_width_scale(ctx) result(scale)

Get width scale - now returns 1.0 since page size matches figure size

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx

Return Value real(kind=wp)

public function pdf_get_height_scale(ctx) result(scale)

Get height scale - now returns 1.0 since page size matches figure size

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx

Return Value real(kind=wp)


Subroutines

public subroutine normalize_to_pdf_coords(ctx, x, y, pdf_x, pdf_y)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: y
real(kind=wp), intent(out) :: pdf_x
real(kind=wp), intent(out) :: pdf_y

public subroutine pdf_fill_quad(ctx, stream_writer, x_quad, y_quad)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx
type(*), intent(inout) :: stream_writer
real(kind=wp), intent(in) :: x_quad(4)
real(kind=wp), intent(in) :: y_quad(4)

public subroutine pdf_fill_heatmap(ctx, stream_writer, x_grid, y_grid, z_grid, z_min, z_max)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx
type(*), intent(inout) :: stream_writer
real(kind=wp), intent(in) :: x_grid(:)
real(kind=wp), intent(in) :: y_grid(:)
real(kind=wp), intent(in) :: z_grid(:,:)
real(kind=wp), intent(in) :: z_min
real(kind=wp), intent(in) :: z_max

public subroutine pdf_render_legend_specialized(ctx, entries, x, y, width, height)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(inout) :: ctx
type(legend_entry_t), intent(in), dimension(:) :: entries
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: y
real(kind=wp), intent(in) :: width
real(kind=wp), intent(in) :: height

public subroutine pdf_calculate_legend_dimensions(ctx, entries, width, height)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx
type(legend_entry_t), intent(in), dimension(:) :: entries
real(kind=wp), intent(out) :: width
real(kind=wp), intent(out) :: height

public subroutine pdf_set_legend_border_width(ctx, width)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(inout) :: ctx
real(kind=wp), intent(in) :: width

public subroutine pdf_calculate_legend_position(ctx, loc, x, y)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx
character(len=*), intent(in) :: loc
real(kind=wp), intent(out) :: x
real(kind=wp), intent(out) :: y

public subroutine pdf_extract_rgb_data(ctx, width, height, rgb_data)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx
integer, intent(in) :: width
integer, intent(in) :: height
real(kind=wp), intent(out) :: rgb_data(width,height,3)

public subroutine pdf_get_png_data(ctx, width, height, png_data, status)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(in) :: ctx
integer, intent(in) :: width
integer, intent(in) :: height
integer(kind=1), intent(out), allocatable :: png_data(:)
integer, intent(out) :: status

public subroutine pdf_prepare_3d_data(ctx, plots)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(inout) :: ctx
type(plot_data_t), intent(in) :: plots(:)

public subroutine pdf_render_ylabel(ctx, ylabel)

Arguments

Type IntentOptional Attributes Name
type(pdf_context_handle), intent(inout) :: ctx
character(len=*), intent(in) :: ylabel

public subroutine safe_coordinate_transform(x, y, x_min, x_max, y_min, y_max, plot_left, plot_width, plot_bottom, plot_height, pdf_x, pdf_y)

Safe coordinate transformation with aspect ratio preservation Updated to maintain correct aspect ratios like normalize_to_pdf_coords

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: y
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) :: plot_left
real(kind=wp), intent(in) :: plot_width
real(kind=wp), intent(in) :: plot_bottom
real(kind=wp), intent(in) :: plot_height
real(kind=wp), intent(out) :: pdf_x
real(kind=wp), intent(out) :: pdf_y