fortplot_pcolormesh Module

Pcolormesh (pseudocolor mesh) plotting functionality

Provides 2D scalar field visualization using colored quadrilaterals on regular or irregular grids. Compatible with matplotlib pcolormesh.

Following SOLID principles: - Single Responsibility: Only handles pcolormesh data structures - Open/Closed: Extensible for different shading modes - Interface Segregation: Minimal, focused interface



Derived Types

type, public ::  pcolormesh_t

Pcolormesh data container Stores grid vertices and color data for quadrilateral mesh rendering

Components

Type Visibility Attributes Name Initial
real(kind=wp), public, allocatable :: x_vertices(:,:)
real(kind=wp), public, allocatable :: y_vertices(:,:)
real(kind=wp), public, allocatable :: c_values(:,:)
character(len=20), public :: colormap_name = 'viridis'
real(kind=wp), public :: vmin = -huge(1.0_wp)
real(kind=wp), public :: vmax = huge(1.0_wp)
logical, public :: vmin_set = .false.
logical, public :: vmax_set = .false.
logical, public :: show_edges = .false.
real(kind=wp), public, dimension(3) :: edge_color = [0.0_wp, 0.0_wp, 0.0_wp]
real(kind=wp), public :: edge_width = 0.5_wp
real(kind=wp), public :: alpha = 1.0_wp
integer, public :: nx = 0
integer, public :: ny = 0

Type-Bound Procedures

procedure, public :: initialize_regular_grid
procedure, public :: initialize_irregular_grid
procedure, public :: get_data_range
procedure, public :: get_quad_vertices

Subroutines

public subroutine validate_pcolormesh_grid(x_coords, y_coords, c_data, error)

Validate grid dimensions for pcolormesh

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x_coords(:)
real(kind=wp), intent(in) :: y_coords(:)
real(kind=wp), intent(in) :: c_data(:,:)
type(fortplot_error_t), intent(out), optional :: error

public subroutine create_regular_mesh_grid(x_1d, y_1d, x_2d, y_2d)

Create 2D meshgrid from 1D coordinate arrays Used internally for regular grid setup

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x_1d(:)
real(kind=wp), intent(in) :: y_1d(:)
real(kind=wp), intent(out) :: x_2d(:,:)
real(kind=wp), intent(out) :: y_2d(:,:)