fortplot_streamplot_arrow_utils Module

Shared utilities for streamplot arrow placement



Functions

public pure function map_grid_index_to_coord(grid_index, grid_values) result(coord)

Convert matplotlib-style grid index to data coordinate

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: grid_index
real(kind=wp), intent(in) :: grid_values(:)

Return Value real(kind=wp)


Subroutines

public subroutine validate_streamplot_arrow_parameters(arrowsize_opt, arrowstyle_opt, arrow_size_val, arrow_style_val, has_error)

Validate arrow size and style inputs (matplotlib compatible)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), optional :: arrowsize_opt
character(len=*), intent(in), optional :: arrowstyle_opt
real(kind=wp), intent(out) :: arrow_size_val
character(len=10), intent(out) :: arrow_style_val
logical, intent(out) :: has_error

public subroutine compute_streamplot_arrows(trajectories, n_trajectories, trajectory_lengths, x_grid, y_grid, arrow_size, arrow_style, arrows)

Compute arrow metadata for streamlines based on trajectory geometry

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: trajectories(:,:,:)
integer, intent(in) :: n_trajectories
integer, intent(in) :: trajectory_lengths(:)
real(kind=wp), intent(in) :: x_grid(:)
real(kind=wp), intent(in) :: y_grid(:)
real(kind=wp), intent(in) :: arrow_size
character(len=*), intent(in) :: arrow_style
type(arrow_data_t), intent(out), allocatable :: arrows(:)

public subroutine replace_stream_arrows(state, arrows)

Replace figure state stream arrows and manage rendered flag

Arguments

Type IntentOptional Attributes Name
type(figure_state_t), intent(inout) :: state
type(arrow_data_t), intent(inout), allocatable :: arrows(:)