fortplot_layout Module

Layout and margin calculations for plotting backends

This module handles plot area geometry and margin calculations, following Single Responsibility Principle by focusing solely on layout-related functionality.

Author: fortplot contributors



Derived Types

type, public ::  plot_margins_t

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: left = 0.125_wp
real(kind=wp), public :: right = 0.9_wp
real(kind=wp), public :: bottom = 0.11_wp
real(kind=wp), public :: top = 0.88_wp

type, public ::  plot_area_t

Components

Type Visibility Attributes Name Initial
integer, public :: left
integer, public :: bottom
integer, public :: width
integer, public :: height

Subroutines

public subroutine calculate_plot_area(canvas_width, canvas_height, margins, plot_area)

Calculate plot area based on canvas size and margins (matplotlib-compatible) Note: left/bottom are margins, right/top are edge positions

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: canvas_width
integer, intent(in) :: canvas_height
type(plot_margins_t), intent(in) :: margins
type(plot_area_t), intent(out) :: plot_area