Skip to content

foresight_annotations ​

foresight_annotations, labels, arrows and objects placed on a panel (gnuplot set label, set arrow, set object).

A position is two coordinates, each in its system: first (the x or y axis values), second (the x2 or y2 ones), graph (fractions of the plot area from its bottom left), screen (fractions of the page) or character (character cells from the page's bottom left: 0.6 of the font size wide, the font size high, as the label offsets), as gnuplot.

Labels and arrows are not clipped, as gnuplot's; objects are clipped by the plot area when both coordinates of every point are axis values (gnuplot's default clip), drawn in data space then (the interactive viewer zooms them with the data); else on the page. Layers: back (the default) behind the data, front over the frame, behind (objects) behind the grid too.

Source: src/lib/foresight_annotations.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
FRAME_COLORcharacter(len=*)parameterDefault text and line color (the theme maps it).
PIreal(kind=R8P)parameterpi.

Derived Types ​

place_object ​

A position: its coordinates and the system of each.

Components

NameTypeAttributesDescription
xreal(kind=R8P)Abscissa.
yreal(kind=R8P)Ordinate.
sxcharacter(len=9)System of the abscissa: first, second, graph, screen, character.
sycharacter(len=9)System of the ordinate.
zreal(kind=R8P)Height (gnuplot's third coordinate, the 3D views').
szcharacter(len=9)System of the height: first (z axis values), graph, screen.

label_object ​

A label, gnuplot set label.

Components

NameTypeAttributesDescription
taginteger(kind=I4P)Tag (set label N).
plainlogicalThe text as it is, not enhanced text (noenhanced).
textcharacter(len=:)allocatableText.
attype(place_object)Position.
justifycharacter(len=6)left, center or right of the position.
rotatereal(kind=R8P)Angle [deg, counterclockwise].
colorcharacter(len=:)allocatableText color, the frame's if empty.
frontlogicalOver the frame, else behind the data.
pointlogicalA point marks the position.
ptinteger(kind=I4P)Point type.
psreal(kind=R8P)Point size.
fonttype(font_object)Font (set label font "...").
offsetreal(kind=R8P)Text offset [y upward], in offset_system.
offset_systemcharacter(len=9)Systems of the offset: character, first, second, graph, screen (gnuplot's position).
boxedlogicalOn the background (gnuplot boxed, a drawn text box style).
paletteinteger(kind=I4P)Palette color: 1 of its z (tc palette z), 2 of a color axis value (cb V), 3 of a fraction (frac F); 0 none.
palette_valuereal(kind=R8P)The value V or the fraction F.

arrow_object ​

An arrow, gnuplot set arrow.

Components

NameTypeAttributesDescription
taginteger(kind=I4P)Tag (set arrow N).
fromtype(place_object)Tail.
totype(place_object)Tip, or the tip from the tail (rto).
relativelogicalrto: to is relative to from.
headinteger(kind=I4P)Heads: 0 none, 1 at the tip, 2 at the tail, 3 both.
lengthreal(kind=R8P)Head length (0: the default head).
length_systemcharacter(len=9)System of the head length (x direction).
anglereal(kind=R8P)Head barb angle [deg].
fixedlogicalThe head keeps its size on a short arrow (fixed).
fillcharacter(len=8)Heads nofilled (two barbs), filled, empty, noborder.
frontlogicalOver the frame, else behind the data.
polarlogicalThe tip by a length and an angle from the tail (gnuplot length L angle A), not by to.
spanreal(kind=R8P)That length, negative backwards.
span_systemcharacter(len=9)Its system (along x: first, second, graph, screen, character).
directionreal(kind=R8P)That angle on the page [deg, counterclockwise from x].
colorcharacter(len=:)allocatableLine color, the frame's if empty.
lwreal(kind=R8P)Line width [px].
dashescharacter(len=:)allocatableSVG dash array, empty for solid.

shape_object ​

An object, gnuplot set object: a rectangle, circle, ellipse or polygon.

Components

NameTypeAttributesDescription
taginteger(kind=I4P)Tag (set object N).
kindcharacter(len=9)rectangle, circle, ellipse, polygon.
pointstype(place_object)allocatableRectangle corners (2) or centre (1, with size); circle and ellipse centre; polygon vertices.
sizetype(place_object)Rectangle and ellipse width and height, circle radius (x, in the system sx).
sizedlogicalThe rectangle is given by its centre and size.
anglereal(kind=R8P)Ellipse orientation [deg].
arcreal(kind=R8P)Circle arc [deg].
styletype(style_object)Fill, border, color, line width.
layercharacter(len=6)behind, back, front, depth (gnuplot's depthorder: a 3D polygon sorted with the pm3d quadrangles), fb (a wall).
cliplogicalClipped by the plot area (axis coordinates only).
back_colorcharacter(len=:)allocatablefc ls N of a depthorder polygon: the color of its back (line style N+1, gnuplot's 2-sided coloring).

pixmap_object ​

An image from a PNG file, gnuplot set pixmap.

Components

NameTypeAttributesDescription
taginteger(kind=I4P)Tag (set pixmap N).
pngcharacter(len=:)allocatableThe file, base64.
wide_pngcharacter(len=:)allocatableA colormap's entries as a row (colormap NAME), base64: drawn when more than twice as wide as high (gnuplot's).
pixelsinteger(kind=I4P)Its width and height [pixels].
attype(place_object)Position: the lower left corner, or the centre.
spantype(place_object)Width and height, each in its system.
sizedinteger(kind=I4P)0 its pixels, 1 size (both), 2 width (the height by the aspect), 3 height (the width by the aspect).
centerlogicalat is the centre.
layercharacter(len=6)behind, back or front (gnuplot's default).

frame_object ​

What a position needs: the plot area, the page, the axes.

Components

NameTypeAttributesDescription
areareal(kind=R8P)Plot area: left, right, top, bottom [px].
canvasreal(kind=R8P)Page width and height [px].
cellreal(kind=R8P)Character cell width and height [px].

Interfaces ​

push ​

Append an item through a temporary: nvfortran 26.9 corrupts list = [list, item] when the items hold deferred-length characters.

Module procedures: push_label, push_arrow, push_shape, push_pixmap

Subroutines ​

draw_labels ​

The labels of the layer (front or not): text at the position, justified, rotated, moved by the offset; a point marking the position if so set. Those tied to the data in the fs-anchored group (the viewer hides it while zoomed), the others in fs-annotations. Line start. Line end. Line counter.

fortran
subroutine draw_labels(labels, front, backend, area, canvas, font_size, xaxis, yaxis, x2axis, y2axis)

Arguments

NameTypeIntentAttributesDescription
labelstype(label_object)inLabels.
frontlogicalinThe front layer, else the back one.
backendclass(backend_object)inoutOutput device.
areareal(kind=R8P)inPlot area: left, right, top, bottom [px].
canvasreal(kind=R8P)inPage width and height [px].
font_sizereal(kind=R8P)inFont size [px].
xaxistype(axis_object)inx axis.
yaxistype(axis_object)iny axis.
x2axistype(axis_object)inx2 axis.
y2axistype(axis_object)iny2 axis.

Call graph

draw_arrows ​

The arrows of the layer (front or not): a shaft from the tail to the tip, heads as set (nofilled two barbs, filled, empty, noborder a triangle). Those tied to the data in the fs-anchored group.

fortran
subroutine draw_arrows(arrows, front, backend, area, canvas, font_size, xaxis, yaxis, x2axis, y2axis)

Arguments

NameTypeIntentAttributesDescription
arrowstype(arrow_object)inArrows.
frontlogicalinThe front layer, else the back one.
backendclass(backend_object)inoutOutput device.
areareal(kind=R8P)inPlot area: left, right, top, bottom [px].
canvasreal(kind=R8P)inPage width and height [px].
font_sizereal(kind=R8P)inFont size [px].
xaxistype(axis_object)inx axis.
yaxistype(axis_object)iny axis.
x2axistype(axis_object)inx2 axis.
y2axistype(axis_object)iny2 axis.

Call graph

draw_pixmaps ​

The pixmaps of layer (behind, back, front), gnuplot set pixmap: each PNG at its position (its lower left corner, or its centre), its own pixels large, or size W,H, or width W (or height H) the other side by its aspect; W and H in their systems (first and second measured from the position, graph, screen fractions, character cells). Those tied to the data in the fs-anchored group (hidden by the viewer while zoomed).

fortran
subroutine draw_pixmaps(pixmaps, layer, backend, area, canvas, font_size, xaxis, yaxis, x2axis, y2axis)

Arguments

NameTypeIntentAttributesDescription
pixmapstype(pixmap_object)inPixmaps.
layercharacter(len=*)inLayer.
backendclass(backend_object)inoutOutput device.
areareal(kind=R8P)inPlot area: left, right, top, bottom [px].
canvasreal(kind=R8P)inPage width and height [px].
font_sizereal(kind=R8P)inFont size [px].
xaxistype(axis_object)inx axis.
yaxistype(axis_object)iny axis.
x2axistype(axis_object)inx2 axis.
y2axistype(axis_object)iny2 axis.

Call graph

draw_shapes ​

The objects of layer (behind, back, front), those in data space (data_space: clipped, both coordinates axis values, drawn in the unit square) or the others (on the page): rectangles, circles (an arc and its centre for a partial one), ellipses, polygons, in their fill and border.

fortran
subroutine draw_shapes(shapes, layer, data_space, backend, area, canvas, font_size, xaxis, yaxis, x2axis, y2axis)

Arguments

NameTypeIntentAttributesDescription
shapestype(shape_object)inObjects.
layercharacter(len=*)inLayer.
data_spacelogicalinThe data space ones, else the page ones.
backendclass(backend_object)inoutOutput device.
areareal(kind=R8P)inPlot area: left, right, top, bottom [px].
canvasreal(kind=R8P)inPage width and height [px].
font_sizereal(kind=R8P)inFont size [px].
xaxistype(axis_object)inx axis.
yaxistype(axis_object)iny axis.
x2axistype(axis_object)inx2 axis.
y2axistype(axis_object)iny2 axis.

Call graph

push_label ​

Append item to list through a temporary.

Attributes: pure

fortran
subroutine push_label(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(label_object)inoutallocatableList.
itemtype(label_object)inNew item.

push_arrow ​

Append item to list through a temporary.

Attributes: pure

fortran
subroutine push_arrow(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(arrow_object)inoutallocatableList.
itemtype(arrow_object)inNew item.

push_pixmap ​

Append item to list.

Attributes: pure

fortran
subroutine push_pixmap(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(pixmap_object)inoutallocatableList.
itemtype(pixmap_object)inItem.

push_shape ​

Append item to list through a temporary.

Attributes: pure

fortran
subroutine push_shape(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(shape_object)inoutallocatableList.
itemtype(shape_object)inNew item.

Functions ​

in_data ​

Whether both coordinates of p are axis values (first, second).

Attributes: pure

Returns: logical

fortran
function in_data(p) result(yes)

Arguments

NameTypeIntentAttributesDescription
ptype(place_object)inPosition.

Call graph

anchored ​

Whether a coordinate of p is an axis value: the label or arrow moves with the data.

Attributes: pure

Returns: logical

fortran
function anchored(p) result(yes)

Arguments

NameTypeIntentAttributesDescription
ptype(place_object)inPosition.

Call graph

unit_of ​

p in the unit square of the plot area (x right, y up); NaN for a value its log axis cannot place.

Attributes: pure

Returns: real(kind=R8P)

fortran
function unit_of(p, xaxis, yaxis, x2axis, y2axis) result(u)

Arguments

NameTypeIntentAttributesDescription
ptype(place_object)inPosition.
xaxistype(axis_object)inx axis.
yaxistype(axis_object)iny axis.
x2axistype(axis_object)inx2 axis.
y2axistype(axis_object)iny2 axis.

Call graph

label_shift ​

The offset of label on the page [px, y downward], gnuplot's get_offsets (map_position_r): each coordinate in its system, character (the cell, gnuplot's svg 0.7 by 1.5 of the font size), graph (the plot area), screen (the page less a terminal unit), first and second (the axis' scale: the distance from its 0); the non-character ones truncated to gnuplot's svg units (1/100 px, an int cast).

Attributes: pure

Returns: real(kind=R8P)

fortran
function label_shift(label, frame, xaxis, yaxis, x2axis, y2axis) result(d)

Arguments

NameTypeIntentAttributesDescription
labeltype(label_object)inLabel.
frametype(frame_object)inPlot area and page.
xaxistype(axis_object)inx axis.
yaxistype(axis_object)iny axis.
x2axistype(axis_object)inx2 axis.
y2axistype(axis_object)iny2 axis.

Call graph

page_of ​

p on the page [px, y downward]; huge for an unplaceable value.

Attributes: pure

Returns: real(kind=R8P)

fortran
function page_of(p, frame, xaxis, yaxis, x2axis, y2axis) result(xy)

Arguments

NameTypeIntentAttributesDescription
ptype(place_object)inPosition.
frametype(frame_object)inPlot area and page.
xaxistype(axis_object)inx axis.
yaxistype(axis_object)iny axis.
x2axistype(axis_object)inx2 axis.
y2axistype(axis_object)iny2 axis.

Call graph

span_of ​

The page size [px] of a width and height span (its systems in sx, sy) about centre: axis values measured across the centre (a log axis included), graph and screen ones as fractions, character ones in cells.

Attributes: pure

Returns: real(kind=R8P)

fortran
function span_of(centre, span, frame, xaxis, yaxis, x2axis, y2axis) result(size_px)

Arguments

NameTypeIntentAttributesDescription
centretype(place_object)inCentre.
spantype(place_object)inWidth and height.
frametype(frame_object)inPlot area and page.
xaxistype(axis_object)inx axis.
yaxistype(axis_object)iny axis.
x2axistype(axis_object)inx2 axis.
y2axistype(axis_object)iny2 axis.

Call graph

in_space ​

Whether shape is drawn in data space: clipped, every point (and the size) in axis values.

Attributes: pure

Returns: logical

fortran
function in_space(shape) result(yes)

Arguments

NameTypeIntentAttributesDescription
shapetype(shape_object)inObject.

Call graph

has_shapes ​

Whether any of shapes is of layer and in data space (data_space), or on the page.

Attributes: pure

Returns: logical

fortran
function has_shapes(shapes, layer, data_space) result(yes)

Arguments

NameTypeIntentAttributesDescription
shapestype(shape_object)inObjects.
layercharacter(len=*)inLayer.
data_spacelogicalinThe data space ones, else the page ones.

Call graph

color_of ​

color, the frame's if unallocated or empty.

Attributes: pure

Returns: character(len=:)

fortran
function color_of(color) result(c)

Arguments

NameTypeIntentAttributesDescription
colorcharacter(len=:)inallocatableColor.

Call graph

dashes_of ​

SVG dash array of arrow, empty for solid.

Attributes: pure

Returns: character(len=:)

fortran
function dashes_of(arrow) result(d)

Arguments

NameTypeIntentAttributesDescription
arrowtype(arrow_object)inArrow.

Call graph

anchor_of ​

SVG text anchor of a justification.

Attributes: pure

Returns: character(len=:)

fortran
function anchor_of(justify) result(anchor)

Arguments

NameTypeIntentAttributesDescription
justifycharacter(len=*)inleft, center, right.

Call graph

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