Skip to content

foresight_axis ​

foresight_axis, a plot axis: user settings and the derived effective range and ticks.

Range semantics follow gnuplot set xrange [min:max]: min is the value at the axis start and max at its end (min > max reverses the axis); an unset end is autoscaled to the data and extended outward to the tick grid.

Text labels from the data (using ...:xtic(1)), when any, replace the ticks, as gnuplot: a tick at each labelled value inside the range, the range itself not extended. They are derived per rendering (labels), never stored in the user settings tics, so a multiplot does not carry the categories of a panel into the next one.

Source: src/lib/foresight_axis.F90

Dependencies

Contents ​

Derived Types ​

axis_object ​

Plot axis.

Components

NameTypeAttributesDescription
has_datalogicalData placed on the axis, set by setup.
noextendlogicalAutoscaled ends not extended to the ticks, set by the user (gnuplot set autoscale noextend, fix).
data_loreal(kind=R8P)Smallest data value placed, set by setup.
data_hireal(kind=R8P)Largest data value placed, set by setup.
offsetreal(kind=R8P)Autoscaled ends moved out, start and end (gnuplot set offsets): in axis units, or graph fractions.
offset_graphlogicaloffset in graph fractions of the autoscaled range.
labelcharacter(len=:)allocatableAxis label, empty for none.
loglogicalBase-10 logarithmic scale.
min_fixedlogicalAxis start set by the user, else autoscaled.
max_fixedlogicalAxis end set by the user, else autoscaled.
min_userreal(kind=R8P)User value at the axis start.
max_userreal(kind=R8P)User value at the axis end.
plot_min_fixedlogicalAxis start of the current plot, over the user one, gnuplot plot [min:max].
plot_max_fixedlogicalAxis end of the current plot, over the user one.
plot_minreal(kind=R8P)Value at the axis start of the current plot.
plot_maxreal(kind=R8P)Value at the axis end of the current plot.
loreal(kind=R8P)Effective value at the axis start, set by setup.
hireal(kind=R8P)Effective value at the axis end, set by setup.
ticstype(tics_object)User tick settings: fixed step, none, label format.
timelogicalTime values (seconds since 1970): time ticks and labels, gnuplot set xdata time.
timefmtcharacter(len=:)allocatableInput time format, the day and month order of the invented labels (gnuplot set timefmt).
tightlogicalAutoscaled ends not extended to the ticks (images, the color axis), as gnuplot.
tickstype(tick_object)allocatableTicks, set by setup.
labelstype(tick_object)allocatableText labels from the data, by value; none if unallocated or empty.
reverselogicalReversed when an end is autoscaled (gnuplot set xrange reverse).
boundedlogicalLimits of the autoscaled ends given: (end, lower or upper), gnuplot set xrange [lb<*<ub:lb<*<ub].
limitsreal(kind=R8P)Those limits.
map_ureal(kind=R8P)allocatableA nonlinear axis (gnuplot set nonlinear): unit positions, increasing, of the table; unallocated for a linear or log axis.
map_xreal(kind=R8P)allocatableIts values at them, NaN where undefined (a broken axis).
map_freal(kind=R8P)allocatableThose values with each NaN filled by the last defined one (the search).
map_signreal(kind=R8P)1 if the values grow along the table, -1 if they fall.

Type-Bound Procedures

NameAttributesDescription
acceptspass(self)Whether a value can be placed on the axis.
has_labelpass(self)Whether the axis has a label.
labelledpass(self)Whether text labels from the data replace the ticks.
range_ofpass(self)Range before the tick extension.
set_rangepass(self)Set the range, gnuplot style.
setuppass(self)Compute effective range and ticks.
to_unitpass(self)Map a value to the unit interval.

Subroutines ​

set_range ​

Set the range as gnuplot set xrange [min:max]: an absent end is autoscaled.

Attributes: pure

fortran
subroutine set_range(self, min, max)

Arguments

NameTypeIntentAttributesDescription
selfclass(axis_object)inoutAxis.
minreal(kind=R8P)inoptionalValue at the axis start.
maxreal(kind=R8P)inoptionalValue at the axis end.

Call graph

range_of ​

Values at the axis start and end from the data extent and the user ends, before the extension to the ticks: the range functions are sampled on, as gnuplot.

A degenerate range is widened by 1% (gnuplot "empty range" behaviour); with no data the range defaults to [-10:10], or [1:10] on a log axis.

Attributes: pure

fortran
subroutine range_of(self, dmin, dmax, has_data, lo, hi)

Arguments

NameTypeIntentAttributesDescription
selfclass(axis_object)inAxis.
dminreal(kind=R8P)inSmallest placeable data value.
dmaxreal(kind=R8P)inLargest placeable data value.
has_datalogicalinWhether dmin/dmax are meaningful.
loreal(kind=R8P)outValue at the axis start.
hireal(kind=R8P)outValue at the axis end.

Call graph

setup ​

Compute the effective range (range_of) and the ticks from the data extent and the axis length.

fortran
subroutine setup(self, dmin, dmax, has_data, npx)

Arguments

NameTypeIntentAttributesDescription
selfclass(axis_object)inoutAxis.
dminreal(kind=R8P)inSmallest placeable data value.
dmaxreal(kind=R8P)inLargest placeable data value.
has_datalogicalinWhether dmin/dmax are meaningful.
npxreal(kind=R8P)inAxis length [px].

Call graph

Functions ​

paxis_default ​

A parallel axis as set at first: autoscaled to its values without extension, no ticks. Built by components, not by a structure constructor: nvfortran 26.9 -O0 leaves the default-initialized array components (bounded) of a constructed axis undefined.

Attributes: pure

Returns: type(axis_object)

fortran
function paxis_default() result(axis)

Call graph

accepts ​

Whether v can be placed on the axis: finite, and positive on a log axis.

Attributes: elemental

Returns: logical

fortran
function accepts(self, v) result(ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(axis_object)inAxis.
vreal(kind=R8P)inValue.

Call graph

has_label ​

Whether the axis has a non-empty label.

Attributes: pure

Returns: logical

fortran
function has_label(self) result(has)

Arguments

NameTypeIntentAttributesDescription
selfclass(axis_object)inAxis.

Call graph

labelled ​

Whether text labels from the data replace the ticks: some are set and the ticks are not turned off.

Attributes: pure

Returns: logical

fortran
function labelled(self) result(yes)

Arguments

NameTypeIntentAttributesDescription
selfclass(axis_object)inAxis.

Call graph

to_unit ​

Map the placeable value v to the axis unit interval: 0 at the axis start, 1 at its end.

Attributes: elemental

Returns: real(kind=R8P)

fortran
function to_unit(self, v) result(u)

Arguments

NameTypeIntentAttributesDescription
selfclass(axis_object)inAxis.
vreal(kind=R8P)inValue.

Call graph

map_unit ​

The unit position of v on a nonlinear axis by its table (map_* of axis_object): linear between the two entries around v (the first such pair, so an entry right at the edge of an undefined part is found defined), NaN if one of them is undefined, extrapolated beyond the ends.

Attributes: pure

Returns: real(kind=R8P)

fortran
function map_unit(mu, mx, mf, sgn, v) result(u)

Arguments

NameTypeIntentAttributesDescription
mureal(kind=R8P)inUnit positions.
mxreal(kind=R8P)inValues, NaN where undefined.
mfreal(kind=R8P)inValues, filled.
sgnreal(kind=R8P)inDirection of the values.
vreal(kind=R8P)inValue.

Call graph

Released under the GPL v3, BSD 2-Clause, BSD 3-Clause or MIT License.