Tick generation and formatting for all scale types
This module handles all tick-related functionality including linear, logarithmic, and symmetric logarithmic tick generation, following Single Responsibility Principle by focusing solely on tick calculation and formatting.
Author: fortplot contributors
Format tick value based on data range like matplotlib
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | value | |||
real(kind=wp), | intent(in) | :: | range |
Smart tick value formatting with automatic exponential notation for long labels Limits output to max_chars and uses exponential notation when needed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | value | |||
integer, | intent(in) | :: | max_chars |
Format logarithmic tick values using scientific notation like matplotlib
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | value |
Format tick value with consistent decimal places for uniform appearance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | value | |||
integer, | intent(in) | :: | decimal_places |
Calculate appropriate tick labels at nice locations like matplotlib Ensures all labels have consistent formatting and nice round numbers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | data_min | |||
real(kind=wp), | intent(in) | :: | data_max | |||
integer, | intent(in) | :: | num_ticks | |||
character(len=20), | intent(out) | :: | labels(:) |
Calculate logarithmic tick labels at powers of 10 with sub-ticks
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | data_min | |||
real(kind=wp), | intent(in) | :: | data_max | |||
integer, | intent(in) | :: | num_ticks | |||
character(len=20), | intent(out) | :: | labels(:) |
Calculate symlog tick labels with improved linear and log regions
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | data_min | |||
real(kind=wp), | intent(in) | :: | data_max | |||
real(kind=wp), | intent(in) | :: | linear_threshold | |||
integer, | intent(in) | :: | num_ticks | |||
character(len=20), | intent(out) | :: | labels(:) |
Calculate nice axis limits that encompass the data like matplotlib The axis limits are set to nice round numbers based on tick locations
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | data_min | |||
real(kind=wp), | intent(in) | :: | data_max | |||
integer, | intent(in) | :: | target_num_ticks | |||
real(kind=wp), | intent(out) | :: | nice_min | |||
real(kind=wp), | intent(out) | :: | nice_max |
Find nice tick locations following matplotlib's MaxNLocator algorithm exactly
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | data_min | |||
real(kind=wp), | intent(in) | :: | data_max | |||
integer, | intent(in) | :: | target_num_ticks | |||
real(kind=wp), | intent(out) | :: | nice_min | |||
real(kind=wp), | intent(out) | :: | nice_max | |||
real(kind=wp), | intent(out) | :: | nice_step | |||
real(kind=wp), | intent(out) | :: | tick_locations(:) | |||
integer, | intent(out) | :: | actual_num_ticks |
Generate tick labels based on scale type - common function for all backends
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | data_min | |||
real(kind=wp), | intent(in) | :: | data_max | |||
integer, | intent(in) | :: | num_ticks | |||
character(len=20), | intent(out) | :: | labels(:) | |||
character(len=*), | intent(in), | optional | :: | scale | ||
real(kind=wp), | intent(in), | optional | :: | threshold |