pdf_context Derived Type

type, public, extends(plot_context) :: pdf_context


Components

Type Visibility Attributes Name Initial
integer, public :: width
integer, public :: height
real(kind=wp), public :: x_min
real(kind=wp), public :: x_max
real(kind=wp), public :: y_min
real(kind=wp), public :: y_max
real(kind=wp), public :: view_azim = -1.0471975511965976_wp
real(kind=wp), public :: view_elev = 0.5235987755982988_wp
real(kind=wp), public :: view_dist = 10.0_wp
logical, public :: has_rendered_arrows = .false.
logical, public :: uses_vector_arrows = .false.
logical, public :: has_triangular_arrows = .false.
type(pdf_stream_writer), public :: stream_writer
type(plot_margins_t), public :: margins
type(plot_area_t), public :: plot_area
integer, public :: x_tick_count = 0
integer, public :: y_tick_count = 0
integer, public :: twiny_top_offset = 0
real(kind=wp), public, allocatable :: custom_xtick_positions(:)
real(kind=wp), public, allocatable :: custom_ytick_positions(:)
character(len=50), public, allocatable :: custom_xtick_labels(:)
character(len=50), public, allocatable :: custom_ytick_labels(:)

Type-Bound Procedures

procedure, public :: clear_text_background => context_clear_text_background

Draw text as a fixed-position overlay. Raster/vector backends reuse their normal text path; the ASCII backend overrides this to place the glyphs at the exact cell without the auto-shift its buffered text path applies, so stacked legend rows never blend together.

  • private subroutine context_clear_text_background(this, x, y, width)

    Default no-op: backends that composite text over graphics need no explicit background clearing.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    integer, intent(in) :: width

procedure, public :: draw_text_overlay => context_draw_text_overlay

Select the text-backend charset ('ascii' or 'braille'). Only the text backend carries subpixel dots; raster/vector backends ignore it.

  • private subroutine context_draw_text_overlay(this, x, y, text)

    Default overlay: reuse the backend's normal text path.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    character(len=*), intent(in) :: text

procedure, public :: set_text_charset => context_set_text_charset

Select the text-backend ANSI color mode. Only the text backend emits escapes; raster/vector backends ignore it (#2062).

  • private subroutine context_set_text_charset(this, charset)

    Default no-op: only the text backend renders subpixel charsets.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_context), intent(inout) :: this
    character(len=*), intent(in) :: charset

procedure, public :: set_text_color_mode => context_set_text_color_mode

  • private subroutine context_set_text_color_mode(this, mode)

    Default no-op: only the text backend emits ANSI color escapes.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_context), intent(inout) :: this
    character(len=*), intent(in) :: mode

procedure, public :: line => draw_pdf_line

  • interface

    private module subroutine draw_pdf_line(this, x1, y1, x2, y2)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x1
    real(kind=wp), intent(in) :: y1
    real(kind=wp), intent(in) :: x2
    real(kind=wp), intent(in) :: y2

procedure, public :: color => set_pdf_color

  • interface

    private module subroutine set_pdf_color(this, r, g, b)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: r
    real(kind=wp), intent(in) :: g
    real(kind=wp), intent(in) :: b

procedure, public :: text => draw_pdf_text_wrapper

  • interface

    private module subroutine draw_pdf_text_wrapper(this, x, y, text)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    character(len=*), intent(in) :: text

procedure, public :: draw_text_styled => draw_pdf_text_styled

  • interface

    private module subroutine draw_pdf_text_styled(this, x_pt, y_pt, text, font_size, rotation, ha, va, bbox, color)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x_pt
    real(kind=wp), intent(in) :: y_pt
    character(len=*), intent(in) :: text
    real(kind=wp), intent(in) :: font_size
    real(kind=wp), intent(in) :: rotation
    character(len=*), intent(in) :: ha
    character(len=*), intent(in) :: va
    logical, intent(in) :: bbox
    real(kind=wp), intent(in) :: color(3)

procedure, public :: save => write_pdf_file_facade

  • interface

    private module subroutine write_pdf_file_facade(this, filename)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    character(len=*), intent(in) :: filename

procedure, public :: set_line_width => set_pdf_line_width

  • interface

    private module subroutine set_pdf_line_width(this, width)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: width

procedure, public :: set_line_style => set_pdf_line_style

  • interface

    private module subroutine set_pdf_line_style(this, style)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    character(len=*), intent(in) :: style

procedure, public :: draw_marker => draw_pdf_marker_wrapper

  • interface

    private module subroutine draw_pdf_marker_wrapper(this, x, y, style, size)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    character(len=*), intent(in) :: style
    real(kind=wp), intent(in), optional :: size

procedure, public :: set_marker_colors => set_marker_colors_wrapper

  • interface

    private module subroutine set_marker_colors_wrapper(this, edge_r, edge_g, edge_b, face_r, face_g, face_b)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: edge_r
    real(kind=wp), intent(in) :: edge_g
    real(kind=wp), intent(in) :: edge_b
    real(kind=wp), intent(in) :: face_r
    real(kind=wp), intent(in) :: face_g
    real(kind=wp), intent(in) :: face_b

procedure, public :: set_marker_colors_with_alpha => set_marker_colors_with_alpha_wrapper

  • interface

    private module subroutine set_marker_colors_with_alpha_wrapper(this, edge_r, edge_g, edge_b, edge_alpha, face_r, face_g, face_b, face_alpha)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: edge_r
    real(kind=wp), intent(in) :: edge_g
    real(kind=wp), intent(in) :: edge_b
    real(kind=wp), intent(in) :: edge_alpha
    real(kind=wp), intent(in) :: face_r
    real(kind=wp), intent(in) :: face_g
    real(kind=wp), intent(in) :: face_b
    real(kind=wp), intent(in) :: face_alpha

procedure, public :: draw_arrow => draw_pdf_arrow_wrapper

  • interface

    private module subroutine draw_pdf_arrow_wrapper(this, x, y, dx, dy, size, style)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    real(kind=wp), intent(in) :: dx
    real(kind=wp), intent(in) :: dy
    real(kind=wp), intent(in) :: size
    character(len=*), intent(in) :: style

procedure, public :: draw_arrowhead => draw_pdf_arrowhead_wrapper

  • interface

    private module subroutine draw_pdf_arrowhead_wrapper(this, x, y, dx, dy, size, style)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    real(kind=wp), intent(in) :: dx
    real(kind=wp), intent(in) :: dy
    real(kind=wp), intent(in) :: size
    character(len=*), intent(in) :: style

procedure, public :: get_ascii_output => pdf_get_ascii_output

  • interface

    private module function pdf_get_ascii_output(this) result(output)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(in) :: this

    Return Value character(len=:), allocatable

procedure, public :: get_width_scale => get_width_scale_wrapper

  • interface

    private module function get_width_scale_wrapper(this) result(scale)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(in) :: this

    Return Value real(kind=wp)

procedure, public :: get_height_scale => get_height_scale_wrapper

  • interface

    private module function get_height_scale_wrapper(this) result(scale)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(in) :: this

    Return Value real(kind=wp)

procedure, public :: fill_quad => fill_quad_wrapper

  • interface

    private module subroutine fill_quad_wrapper(this, x_quad, y_quad)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x_quad(4)
    real(kind=wp), intent(in) :: y_quad(4)

procedure, public :: fill_heatmap => fill_heatmap_wrapper

  • interface

    private module subroutine fill_heatmap_wrapper(this, x_grid, y_grid, z_grid, z_min, z_max, colormap_name)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    real(kind=wp), intent(in), contiguous :: x_grid(:)
    real(kind=wp), intent(in), contiguous :: y_grid(:)
    real(kind=wp), intent(in), contiguous :: z_grid(:,:)
    real(kind=wp), intent(in) :: z_min
    real(kind=wp), intent(in) :: z_max
    character(len=*), intent(in), optional :: colormap_name

procedure, public :: extract_rgb_data => extract_rgb_data_wrapper

  • interface

    private module subroutine extract_rgb_data_wrapper(this, width, height, rgb_data)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(in) :: this
    integer, intent(in) :: width
    integer, intent(in) :: height
    real(kind=wp), intent(out) :: rgb_data(width,height,3)

procedure, public :: get_png_data_backend => get_png_data_wrapper

  • interface

    private module subroutine get_png_data_wrapper(this, width, height, png_data, status)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(in) :: this
    integer, intent(in) :: width
    integer, intent(in) :: height
    integer(kind=1), intent(out), allocatable :: png_data(:)
    integer, intent(out) :: status

procedure, public :: prepare_3d_data => prepare_3d_data_wrapper

  • interface

    private module subroutine prepare_3d_data_wrapper(this, plots)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    type(plot_data_t), intent(in) :: plots(:)

procedure, public :: render_ylabel => render_ylabel_wrapper

  • interface

    private module subroutine render_ylabel_wrapper(this, ylabel)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    character(len=*), intent(in) :: ylabel

procedure, public :: draw_axes_and_labels_backend => draw_axes_and_labels_backend_wrapper

  • interface

    private module subroutine draw_axes_and_labels_backend_wrapper(this, xscale, yscale, symlog_threshold, x_min, x_max, y_min, y_max, title, xlabel, ylabel, x_date_format, y_date_format, z_min, z_max, has_3d_plots)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    character(len=*), intent(in) :: xscale
    character(len=*), intent(in) :: yscale
    real(kind=wp), intent(in) :: symlog_threshold
    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
    character(len=:), intent(in), optional, allocatable :: title
    character(len=:), intent(in), optional, allocatable :: xlabel
    character(len=:), intent(in), optional, allocatable :: ylabel
    character(len=*), intent(in), optional :: x_date_format
    character(len=*), intent(in), optional :: y_date_format
    real(kind=wp), intent(in), optional :: z_min
    real(kind=wp), intent(in), optional :: z_max
    logical, intent(in) :: has_3d_plots

procedure, public :: save_coordinates => pdf_save_coordinates

  • interface

    private module subroutine pdf_save_coordinates(this, x_min, x_max, y_min, y_max)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(in) :: this
    real(kind=wp), intent(out) :: x_min
    real(kind=wp), intent(out) :: x_max
    real(kind=wp), intent(out) :: y_min
    real(kind=wp), intent(out) :: y_max

procedure, public :: set_coordinates => pdf_set_coordinates

  • interface

    private module subroutine pdf_set_coordinates(this, x_min, x_max, y_min, y_max)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    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

procedure, public :: render_axes => render_pdf_axes_wrapper

  • interface

    private module subroutine render_pdf_axes_wrapper(this, title_text, xlabel_text, ylabel_text)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    character(len=*), intent(in), optional :: title_text
    character(len=*), intent(in), optional :: xlabel_text
    character(len=*), intent(in), optional :: ylabel_text

procedure, public :: draw_secondary_y_axis => pdf_draw_secondary_y_axis_wrapper

  • interface

    private module subroutine pdf_draw_secondary_y_axis_wrapper(this, yscale, symlog_threshold, y_min, y_max, ylabel, date_format)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    character(len=*), intent(in) :: yscale
    real(kind=wp), intent(in) :: symlog_threshold
    real(kind=wp), intent(in) :: y_min
    real(kind=wp), intent(in) :: y_max
    character(len=:), intent(in), optional, allocatable :: ylabel
    character(len=*), intent(in), optional :: date_format

procedure, public :: draw_secondary_x_axis_top => pdf_draw_secondary_x_axis_top_wrapper

  • interface

    private module subroutine pdf_draw_secondary_x_axis_top_wrapper(this, xscale, symlog_threshold, x_min, x_max, xlabel, date_format)

    Arguments

    Type IntentOptional Attributes Name
    class(pdf_context), intent(inout) :: this
    character(len=*), intent(in) :: xscale
    real(kind=wp), intent(in) :: symlog_threshold
    real(kind=wp), intent(in) :: x_min
    real(kind=wp), intent(in) :: x_max
    character(len=:), intent(in), optional, allocatable :: xlabel
    character(len=*), intent(in), optional :: date_format