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
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.
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.
tightlogicalAutoscaled ends not extended to the ticks (images,
tickstype(tick_object)allocatableTicks, set by setup.
labelstype(tick_object)allocatableText labels from the data, by value; none if unallocated

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 ​

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