fortplot_scales Module

Scale transformation module for coordinate system transformations

This module provides functions for transforming data coordinates using different scale types: linear, logarithmic, and symmetric logarithmic. Follows Single Responsibility Principle by focusing solely on scale transformations.



Functions

public function apply_scale_transform(value, scale_type, threshold) result(transformed)

Apply forward scale transformation to a single value

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: value
character(len=*), intent(in) :: scale_type
real(kind=wp), intent(in) :: threshold

Return Value real(kind=wp)

public function apply_inverse_scale_transform(value, scale_type, threshold) result(original)

Apply inverse scale transformation to recover original value

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: value
character(len=*), intent(in) :: scale_type
real(kind=wp), intent(in) :: threshold

Return Value real(kind=wp)

public function transform_x_coordinate(x, x_min, x_max, width) result(x_screen)

Transform data x-coordinate to screen coordinate

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
integer, intent(in) :: width

Return Value real(kind=wp)

public function transform_y_coordinate(y, y_min, y_max, height, invert) result(y_screen)

Transform data y-coordinate to screen coordinate

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: y
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
integer, intent(in) :: height
logical, intent(in), optional :: invert

Return Value real(kind=wp)


Subroutines

public subroutine clamp_extreme_log_range(data_min, data_max, clamped_min, clamped_max)

Clamp extreme logarithmic ranges to ensure usable plots

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: data_min
real(kind=wp), intent(in) :: data_max
real(kind=wp), intent(out) :: clamped_min
real(kind=wp), intent(out) :: clamped_max