foresight_axes
foresight_axes, a plot panel: the axes, the plotted series, the key and the decorations.
Layout follows gnuplot defaults: full border with inward ticks mirrored on the opposite side, tick labels outside bottom and left, key inside the plot area (top right by default) with right-aligned titles and the samples on their right. A key outside lies in a side margin (left, right) or, centred, above or below the plot; below and above lay its entries out in rows (horizontal), as many per row as the panel width holds.
A second y axis (gnuplot y2) scales the series plotted on it (axes x1y2) on its own, autoscaled from them alone; as gnuplot, its ticks and labels are off until set y2tics (on the right border, not mirrored), and it is drawn only when it has data or a fully fixed range. Text extents are measured by the output device (estimated for vector formats, whose viewer renders the glyphs).
Boxes stand on y = 0 (boxes) and fills reach their baseline (filledcurves y=V): the box edges and the baselines are stored as the bar ends xlow/xhigh and ylow, so they widen the autoscale as error bars do. Unlike gnuplot, which leaves zero out of the y autoscale of boxes and the auto-width edges out of the x one, bars are drawn whole and with lengths proportional to their values.
Histograms (with histograms) lay out their bars from all the histogram series of the panel, as gnuplot: rows at their abscissae (the point numbers 0, 1, ... from a script), clustered the k series side by side in slots 1/(k + gap) wide centred on the row, rowstacked one stack per row, 1 wide, positive values up from 0 and negative ones down from 0; boxwidth scales each bar. The layout is redone at every histogram added, the original values kept in values; the x autoscale reaches one unit beyond the first and last rows, as gnuplot. Unlike gnuplot, clustered bars reach 0 in the y autoscale, as boxes.
Text labels of the abscissae (xtic(N)) of every series replace the x ticks (see foresight_axis).
Circles (with circles, gnuplot) have their radius in x units (2% of the plot width by default) and are drawn round on the page; with two angles [deg, counterclockwise from the x direction] they are wedges. A pie (with pie, a foresight extension) is alone in its panel, without axes: its slices proportional to the values, from 12 o'clock clockwise, each in its palette color, a key entry per slice with its percentage; donut leaves a hole.
Images (with image) color a regular grid of values by the panel palette (foresight_palette) over the color axis cbaxis, autoscaled to the values or set (cbrange), its ends never extended to ticks; the x and y axes of a panel with an image fit its pixel edges, unextended, as gnuplot. The color box lies at the right of the plot area. A theme other than classic replaces the default palette with its own (dark glass to emissive colors for vfd).
A polar panel (polar, gnuplot set polar) keeps its series as theta:r and projects them at each rendering about the pole at r = rmin (the r axis start), x and y autoscaling to the disc of the largest radius; the frame stays rectangular unless set otherwise (border, border_polar, ratio, the x and y ticks off), as gnuplot. Its polar grid, border and r axis line are data geometry (zoomed by a viewer); the r tick labels and theta labels (ttics) are page geometry, in the group fs-polar.
Readouts (with readout, see foresight_readout) show the last finite value of their series in seven-segment digits. They take no part in autoscale, the key or the plot area: they form a block of readouts, in a column or a row, placed inside the plot area as the key is (top left by default) over a window hiding the curves below. A panel of readouts alone has no axes: its block grows to fill the panel, unless a digit size is set.
Source: src/lib/foresight_axes.F90
Dependencies
Contents
- paxis_object
- boxplot_style
- axes_object
- add_series
- data_extent
- render
- draw_frame
- draw_grid
- draw_polar_grid
- draw_polar_axes
- draw_key
- draw_readouts
- key_layout
- draw_series
- outline
- image_range
- layout_histograms
- draw_pie
- draw_gauges
- draw_radar
- draw_rose
- chart_key
- polar_extent
- polar_project
- boxplot_words
- curve_words
- spider_words
- head_words
- label_words
- scan_word
- draw_parallel
- draw_spider
- draw_colorbox
- setup_axes
- axes_names
- readout_position
- key_position
- page_angle
- key_place
- chart_key_width
- polar_series
- parallel_axis
- is_panel_chart
- has_image
- any_image
- effective_palette
- is_readout
- has_title
- place_plot_area
- colorbox_width
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
PAD | real(kind=R8P) | parameter | Outer padding [px]. |
TICK_MAJOR | real(kind=R8P) | parameter | Major tick length [px]. |
TICK_MINOR | real(kind=R8P) | parameter | Minor tick length [px]. |
GAP | real(kind=R8P) | parameter | Gap between border, tick labels and axis labels [px]. |
LINE_HEIGHT | real(kind=R8P) | parameter | Text line height [font size]. |
SAMPLE_LENGTH | real(kind=R8P) | parameter | Key sample length [font size]. |
CAP_LENGTH | real(kind=R8P) | parameter | Error bar cap length [px]. |
FRAME_COLOR | character(len=*) | parameter | Border and tick color. |
GRID_COLOR | character(len=*) | parameter | Grid line color. |
GRID_DASHES | character(len=*) | parameter | Grid line dash array. |
WINDOW_FILL | character(len=*) | parameter | Readout window fill: the page background. |
DIGIT_HEIGHT | real(kind=R8P) | parameter | Default readout digit height [font size]. |
COLORBOX_SIZE | real(kind=R8P) | parameter | Color box width [font size]. |
POLAR_STYLES | character(len=*) | parameter | Styles of a polar panel. |
CIRCLE_SIDES | integer(kind=I4P) | parameter | Sides of the polygon drawing a circle. |
PI_R8 | real(kind=R8P) | parameter | pi. |
Derived Types
paxis_object
A parallel axis (gnuplot set paxis N) of parallel axis plots and spider plots.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
axis | type(axis_object) | Range and ticks: autoscaled to the values without extension, no ticks. | |
label | character(len=:) | allocatable | Label of a spider plot axis, the item title if unallocated. |
boxplot_style
Layout of the boxplots, gnuplot set style boxplot.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
range | real(kind=R8P) | Whiskers to the farthest point within range interquartile ranges. | |
fraction | real(kind=R8P) | If > 0, whiskers spanning this fraction of the points instead. | |
outliers | logical | Draw the points beyond the whiskers. | |
pointtype | integer(kind=I4P) | Point type of the outliers. | |
financebars | logical | Drawn as finance bars, else as candlesticks. | |
median_width | real(kind=R8P) | Median line width [px]; negative: the box line width, 0: none. | |
separation | real(kind=R8P) | Distance between the boxplots of the factor levels. | |
labels | character(len=4) | Factor names as x tick labels: auto (or x), off. | |
sorted | logical | Factor levels in sorted order, else in order of appearance. |
axes_object
Plot panel.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
xaxis | type(axis_object) | Horizontal axis. | |
yaxis | type(axis_object) | Vertical axis. | |
y2axis | type(axis_object) | Second | |
y2_active | logical | The second y axis is drawn, set by setup_axes. | |
series | type(series_object) | allocatable | Plotted series. |
title | character(len=:) | allocatable | Panel title, empty for none. |
grid | logical | Draw grid lines at the major ticks. | |
key | logical | Draw the key. | |
key_h | character(len=6) | Key horizontal position: left, center, right. | |
key_v | character(len=6) | Key vertical position: top, center, bottom. | |
key_box | logical | Draw a box around the key. | |
key_outside | logical | Key outside the plot area (gnuplot outside). | |
key_margin | character(len=6) | top or bottom margin (gnuplot above, below), else | |
key_horizontal | logical | Entries side by side, in rows. | |
origin | real(kind=R8P) | Bottom left corner, page fraction (set origin). | |
size | real(kind=R8P) | Width, height, page fraction (set size). | |
fill_default | type(style_object) | Fill of the filled styles, set style fill (its fill | |
boxwidth | real(kind=R8P) | Box width, set boxwidth; 0 for auto (boxes touching). | |
boxwidth_relative | logical | boxwidth scales the auto width. | |
histogram_rowstacked | logical | Histograms stacked by row, else clustered. | |
histogram_gap | real(kind=R8P) | Gap between clusters [bar slots]. | |
palette | type(palette_object) | Palette of the images, set palette. | |
cbaxis | type(axis_object) | Color axis of the images, set cbrange. | |
colorbox | logical | Draw the color box of the images. | |
readout | logical | Draw the readouts. | |
readout_h | character(len=6) | Readout block horizontal position: left, center, right. | |
readout_v | character(len=6) | Readout block vertical position: top, center, bottom. | |
readout_horizontal | logical | Readouts side by side, else in a column. | |
readout_opaque | logical | Window behind the readouts over a plot. | |
readout_size | real(kind=R8P) | Digit height [px]; 0 for the default, which fills | |
polar | logical | Polar coordinates (set polar): the series are theta:r. | |
degrees | logical | Angles in degrees (set angles degrees), else radians. | |
theta_origin | real(kind=R8P) | Direction of theta = 0 (set theta) [deg, | |
theta_clockwise | logical | Theta grows clockwise. | |
raxis | type(axis_object) | Radial axis: rrange, rtics. | |
raxis_on | logical | Draw the radial axis (set|unset raxis). | |
taxis | type(axis_object) | Angle range of the plotted functions, trange. | |
ttics | type(tics_object) | Theta labels around the polar plot. | |
grid_polar | real(kind=R8P) | Spoke step of the polar grid [deg]; 0: rectangular grid. | |
border | integer(kind=I4P) | Border sides (gnuplot mask): 1 bottom, 2 left, 4 top, 8 | |
border_polar | logical | Circle at the largest r (set border polar). | |
ratio | real(kind=R8P) | Plot area height over width (set size ratio, square is | |
boxplot | type(boxplot_style) | Layout of the boxplots, set style boxplot. | |
paxes | type(paxis_object) | allocatable | Parallel axes p1, p2, ... (set paxis), as many as set. |
spiderplot | logical | Spider plot coordinates (set spiderplot). | |
spider_style | type(style_object) | Polygons of the spider plots (set style spiderplot). | |
grid_spider | logical | Web of the spider plot (set grid spiderplot). |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
add_series | pass(self) | Add a data series. |
data_extent | pass(self) | Extent of the placeable data. |
render | pass(self) | Render the panel. |
draw_frame | pass(self) | Draw border, ticks, labels and title. |
draw_grid | pass(self) | Draw the grid. |
draw_polar_axes | pass(self) | Draw the radial axis and the theta labels. |
draw_polar_grid | pass(self) | Draw the polar grid. |
page_angle | pass(self) | Page angle of a theta. |
draw_key | pass(self) | Draw the key. |
draw_readouts | pass(self) | Draw the readouts. |
key_layout | pass(self) | Key size and entry grid. |
key_place | pass(self) | Where the key lies. |
draw_series | pass(self) | Draw a series. |
has_title | pass(self) | Whether the panel has a title. |
is_readout | pass(self) | Whether a series is a readout. |
has_image | pass(self) | Whether the panel has an image. |
draw_colorbox | pass(self) | Draw the color box. |
draw_pie | pass(self) | Draw a pie panel. |
draw_gauges | pass(self) | Draw a panel of gauges. |
draw_radar | pass(self) | Draw a radar panel. |
draw_rose | pass(self) | Draw a rose panel. |
draw_parallel | pass(self) | Draw a parallel axis panel. |
draw_spider | pass(self) | Draw a spider plot panel. |
parallel_axis | pass(self) | A parallel axis set up for its values. |
colorbox_width | pass(self) | Room of the color box [px]. |
place_plot_area | pass(self) | Plot area from the margins. |
setup_axes | pass(self) | Effective ranges and ticks. |
Subroutines
add_series
Add the series (x, y) with gnuplot-like style options; unset options take gnuplot defaults.
Error bar styles need their bounds: ylow/yhigh for yerrorbars, xlow/xhigh for xerrorbars, all four for xyerrorbars. axes is gnuplot's x1y1 (default) or x1y2, the second y axis. A readout takes its format (DEFAULT_READOUT_FORMAT if absent) and only the color among the style options.
boxes take the box widths width (NaN for the default), else the panel boxwidth, else touching boxes; filledcurves fill to the line y = base, between ylow and y, or the closed polygon of the points. fs (gnuplot fill style words, 'solid 0.5 noborder') overrides the panel fill of either; histograms take the fill too. xlabels are text labels of the abscissae (blank for none), replacing the x ticks.
boxerrorbars are boxes (as boxes) with the y error bars ylow/yhigh; boxxyerror rectangles from xlow to xhigh, ylow to yhigh; candlesticks and financebars take y the opening (or box start), ylow the low, yhigh the high and close the closing (or box end) values, candlesticks a width (else boxwidth, else a few pixels) and whiskerbars. A boxplot takes the values y at the position x(1), one box per level of factors if given (separation apart, named on the x axis), its width width(1) (else boxwidth, else 0.5); the statistics are computed here, with the panel boxplot style.
vectors go from each point by dx, dy; arrows by length and angle; both with head words. ellipses take major (both diameters if alone), minor and angle (the default 5% x 3% of the plot without diameters); polygons close each NaN-separated run of points; labels write labels with the label options; sectors are the annular sectors from azimuth x and radius y by angle and width, about origins.
subroutine add_series(self, x, y, title, with, lc, lw, dt, ps, xlow, xhigh, ylow, yhigh, axes, pt, format, width, base, fs, xlabels, z, radius, angles, donut, scale, linear, close, whiskerbars, factors, dx, dy, length, angle, major, minor, labels, label, head, origins, curve, channels, at)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | inout | Panel. | |
x | real(kind=R8P) | in | Abscissae. | |
y | real(kind=R8P) | in | Ordinates. | |
title | character(len=*) | in | optional | Key title, empty or absent for none. |
with | character(len=*) | in | optional | Plotting style: lines (default), points, linespoints. |
lc | character(len=*) | in | optional | Line color (SVG color); default from the gnuplot palette. |
lw | real(kind=R8P) | in | optional | Line width [px]. |
dt | integer(kind=I4P) | in | optional | Dash type, 1..5. |
ps | real(kind=R8P) | in | optional | Point size scale factor. |
xlow | real(kind=R8P) | in | optional | Horizontal error bar starts. |
xhigh | real(kind=R8P) | in | optional | Horizontal error bar ends. |
ylow | real(kind=R8P) | in | optional | Vertical error bar starts. |
yhigh | real(kind=R8P) | in | optional | Vertical error bar ends. |
axes | character(len=*) | in | optional | Axes of the series: x1y1 or x1y2. |
pt | integer(kind=I4P) | in | optional | gnuplot point type: 0 a dot, 1.. the shapes. |
format | character(len=*) | in | optional | Readout format. |
width | real(kind=R8P) | in | optional | Box widths. |
base | real(kind=R8P) | in | optional | Baseline of a fill. |
fs | character(len=*) | in | optional | Fill style words. |
xlabels | character(len=*) | in | optional | Text labels of the abscissae. |
z | real(kind=R8P) | in | optional | Image values (column, row): x and y are then the pixel |
radius | real(kind=R8P) | in | optional | Circle radii [x units], NaN for the default. |
angles | real(kind=R8P) | in | optional | Wedge start and end angles (2, point) [deg]. |
donut | real(kind=R8P) | in | optional | Pie hole, a fraction of the radius (0 to below 1). |
scale | real(kind=R8P) | in | optional | Gauge scale: the values at the start and end of the sweep. |
linear | logical | in | optional | Rose sectors with the radius (not the area) by value. |
close | real(kind=R8P) | in | optional | Closing prices of candlesticks and finance bars (y the |
whiskerbars | real(kind=R8P) | in | optional | Crossbars of the candlestick whiskers, a fraction of the |
factors | character(len=*) | in | optional | Factor level of each value of a boxplot. |
dx | real(kind=R8P) | in | optional | Vector extents along x. |
dy | real(kind=R8P) | in | optional | Vector extents along y. |
length | real(kind=R8P) | in | optional | Arrow lengths (> 0 x units, in (-1, 0) plot width fraction). |
angle | real(kind=R8P) | in | optional | Arrow or ellipse angles, sector angular extents [the angle |
major | real(kind=R8P) | in | optional | Ellipse major diameters [x units]. |
minor | real(kind=R8P) | in | optional | Ellipse minor diameters [y units]. |
labels | character(len=*) | in | optional | Texts of labels. |
label | character(len=*) | in | optional | Label options: gnuplot with labels words. |
head | character(len=*) | in | optional | Arrowhead words: head, heads, nohead, backhead, |
origins | real(kind=R8P) | in | optional | Sector centres (2, point), [0, 0] if absent. |
curve | character(len=*) | in | optional | Filled curve options: gnuplot closed, x1, x2, |
channels | real(kind=R8P) | in | optional | RGB image colors (4, column, row), 0 to 255: red, |
at | real(kind=R8P) | in | optional | Position of a parallel axis (its number if absent). |
Call graph
data_extent
Extent of the series points placeable on their axes, the whole data before any range is set: x over every series, y per axis (1 the first, 2 the second).
Attributes: pure
subroutine data_extent(self, xmin, xmax, ymin, ymax, found)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
xmin | real(kind=R8P) | out | Smallest abscissa. | |
xmax | real(kind=R8P) | out | Largest abscissa. | |
ymin | real(kind=R8P) | out | Smallest ordinate, per y axis. | |
ymax | real(kind=R8P) | out | Largest ordinate, per y axis. | |
found | logical | out | Any placeable point, per y axis. |
Call graph
render
Render the panel into the pixel box of top-left corner (x0, y0) and size width x height.
subroutine render(self, backend, x0, y0, width, height, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | inout | Panel. | |
backend | class(backend_object) | inout | Output device. | |
x0 | real(kind=R8P) | in | Box left side [px]. | |
y0 | real(kind=R8P) | in | Box top side [px]. | |
width | real(kind=R8P) | in | Box width [px]. | |
height | real(kind=R8P) | in | Box height [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
draw_frame
Draw border, ticks (mirrored if so set), tick labels, axis labels and title.
subroutine draw_frame(self, backend, area, x0, y0, x1, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
area | real(kind=R8P) | in | Plot area: left, right, top, bottom [px]. | |
x0 | real(kind=R8P) | in | Box left side [px]. | |
y0 | real(kind=R8P) | in | Box top side [px]. | |
x1 | real(kind=R8P) | in | Box right side [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
draw_grid
Draw grid lines at the major ticks.
subroutine draw_grid(self, backend, area)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
area | real(kind=R8P) | in | Plot area: left, right, top, bottom [px]. |
Call graph
draw_polar_grid
Draw the polar grid in the plot area: rings at the major r ticks, spokes every grid_polar degrees of theta.
subroutine draw_polar_grid(self, backend)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. |
Call graph
draw_polar_axes
Draw the ticks of the radial axis (a line from the pole to the largest r towards the right of the page whatever the theta origin, drawn with the data) and their labels below it, as gnuplot; and the theta labels (ttics) outside the largest r, with ticks on the polar border. Page geometry: hidden by the viewer while zoomed.
subroutine draw_polar_axes(self, backend, area, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
area | real(kind=R8P) | in | Plot area: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
draw_key
Draw the key at its place (key_place): right-aligned titles, style samples on their right; entries in a column, or row after row (key_horizontal).
subroutine draw_key(self, backend, area, box, font_size, grid, extent)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
area | real(kind=R8P) | in | Plot area: left, right, top, bottom [px]. | |
box | real(kind=R8P) | in | Panel box: left, top, right, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. | |
grid | integer(kind=I4P) | in | Entries, columns, rows (key_layout). | |
extent | real(kind=R8P) | in | Key width and height [px] (key_layout). |
Call graph
draw_readouts
Draw the block of readouts in area, as the key is placed inside the plot area: a column (or a row) of readouts, over an opaque window unless fill, where the readouts are alone in the panel and the digits grow until the block fills area (vector devices; text has one size), unless a digit size is set.
subroutine draw_readouts(self, backend, area, font_size, fill)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
area | real(kind=R8P) | in | Box: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. | |
fill | logical | in | Readouts alone, filling the box. |
Call graph
key_layout
Key grid and size: entries (titled series), columns (1, or as many as room holds when horizontal) and rows; each entry is the widest title, a gap and the sample, with a gap between entries.
Attributes: pure
subroutine key_layout(self, backend, font_size, room, grid, extent)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | in | Output device, for text widths. | |
font_size | real(kind=R8P) | in | Font size [px]. | |
room | real(kind=R8P) | in | Width available to a row of entries [px]. | |
grid | integer(kind=I4P) | out | Entries, columns, rows. | |
extent | real(kind=R8P) | out | Key width and height [px]. |
Call graph
draw_series
Draw the s-th series in the plot area against its vertical axis yaxis; unplaceable points (NaN, non-positive on log axes) break the line.
subroutine draw_series(self, backend, s, yaxis, area, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
s | integer(kind=I4P) | in | Series index. | |
yaxis | type(axis_object) | in | Vertical axis of the series. | |
area | real(kind=R8P) | in | Plot area: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px], for the label offsets. |
Call graph
outline
Outline of a circle (radius r, from a1 to a2 covering 360 degrees and no hole), a wedge (from the centre along the arc from a1 to a2 [deg, counterclockwise]) or, with a hole of radius r_in, a ring sector: the vertices relative to the centre [same unit as r, y upward]; arcs sampled every 360/64 degrees at most.
Attributes: pure
subroutine outline(r, r_in, a1, a2, px, py)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
r | real(kind=R8P) | in | Radius. | |
r_in | real(kind=R8P) | in | Hole radius, 0 for none. | |
a1 | real(kind=R8P) | in | Start angle [deg]. | |
a2 | real(kind=R8P) | in | End angle [deg]; below a1: one more turn, as gnuplot. | |
px | real(kind=R8P) | out | allocatable | Vertex abscissae. |
py | real(kind=R8P) | out | allocatable | Vertex ordinates. |
Call graph
image_range
Range of the finite values of the images among the series all. A module procedure on the series array, as layout_histograms: gfortran 16 debug builds misread self%series(s)%grid through the class dummy.
Attributes: pure
subroutine image_range(all, zmin, zmax, found)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
all | type(series_object) | in | Series of the panel. | |
zmin | real(kind=R8P) | out | Smallest value. | |
zmax | real(kind=R8P) | out | Largest value. | |
found | logical | out | Any finite value. |
layout_histograms
Bars of every histogram series of all from their values: clustered side by side in each row, or stacked by row (positive values up from 0, negative ones down, each sign on its own stack). A module procedure on the series array, not a binding: gfortran 16 corrupts the descriptor of self%series reached through the class dummy after its reallocation by add_series.
subroutine layout_histograms(all, rowstacked, gap, boxwidth)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
all | type(series_object) | inout | Series of the panel. | |
rowstacked | logical | in | Stacked by row, else clustered. | |
gap | real(kind=R8P) | in | Gap between clusters [bar slots]. | |
boxwidth | real(kind=R8P) | in | Bar width factor, 0 for 1. |
Call graph
draw_pie
A pie panel in the box (left, right, top, bottom) [px]: the slices of the values, from 12 o'clock clockwise in the palette colors, a hole of the donut fraction of the radius; the key at the right, an entry per slice with its label and percentage.
subroutine draw_pie(self, backend, box, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
box | real(kind=R8P) | in | Box: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
draw_gauges
Gauges side by side in the box (left, right, top, bottom) [px], one per series: a track of 270 degrees from 7:30 clockwise to 4:30, faint, lit from its start to the last finite value over the gauge scale (in segments cells if set, a cell lit when covered at least half); the scale ticks outside, the value in seven-segment digits under the centre, titled by the series.
subroutine draw_gauges(self, backend, box, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
box | real(kind=R8P) | in | Box: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
draw_radar
A radar (spider) chart in the box (left, right, top, bottom) [px]: a spoke per row, from 12 o'clock clockwise, named by the xtic labels of the first series having them; rings at the ticks of the common radial scale (from 0, or the smallest value if negative, extended to a tick); a polygon per series; the key at the right.
subroutine draw_radar(self, backend, box, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
box | real(kind=R8P) | in | Box: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
draw_rose
A rose (Nightingale) chart in the box (left, right, top, bottom) [px]: equal sectors from 12 o'clock clockwise, one per row in the palette colors, the sector area proportional to the value (its radius with linear); rings at the ticks of the value scale; the key at the right, the sector names.
subroutine draw_rose(self, backend, box, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
box | real(kind=R8P) | in | Box: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
chart_key
A chart key at the top right: an entry per label, a filled sample in its color on the right of its text.
subroutine chart_key(backend, right, top, labels, colors, density, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
backend | class(backend_object) | inout | Output device. | |
right | real(kind=R8P) | in | Key right side [px]. | |
top | real(kind=R8P) | in | Key top [px]. | |
labels | character(len=*) | in | Entries. | |
colors | character(len=*) | in | Sample colors. | |
density | real(kind=R8P) | in | Sample opacity. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
polar_extent
Largest |r| of the points of the series all (theta:r) drawn on a polar panel, readouts aside.
Attributes: pure
subroutine polar_extent(all, rmax, found)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
all | type(series_object) | in | Series, theta:r. | |
rmax | real(kind=R8P) | out | Largest |r|. | |
found | logical | out | Any point. |
polar_project
Project the series all from theta:r to x:y about the pole at r = rmin, as gnuplot: x = (r - rmin) cos(phi), y = (r - rmin) sin(phi), phi the page angle of theta; with cut (a fixed rmin) a point with r below rmin is undefined, else it lies across the pole. Readouts kept. (A module procedure, not a binding: gfortran 16 debug builds misread the components of self%series reached through the class dummy after their reallocation.)
Attributes: pure
subroutine polar_project(all, rmin, cut, degrees, origin, clockwise)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
all | type(series_object) | inout | Series: theta:r in, x:y out. | |
rmin | real(kind=R8P) | in | r at the pole. | |
cut | logical | in | Points below rmin undefined. | |
degrees | logical | in | Theta in degrees, else radians. | |
origin | real(kind=R8P) | in | Page angle of theta = 0 [deg]. | |
clockwise | logical | in | Theta grows clockwise. |
boxplot_words
Update the boxplot style with gnuplot set style boxplot words: range R, fraction F, [no]outliers, pointtype|pt P, candlesticks, financebars, medianlinewidth W, separation S, labels off|auto|x, sorted, unsorted. bad names the first problem, empty if none (the style is then unchanged).
Attributes: pure
subroutine boxplot_words(words, style, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
words | character(len=*) | in | Words. | |
style | type(boxplot_style) | inout | Boxplot style. | |
bad | character(len=:) | out | allocatable | Problem, empty if none. |
Call graph
curve_words
Filled curve options of series from gnuplot words: closed, x1 (to the bottom), x2 (to the top), xy=X,Y (to a point), above, below (where the curve is above or below its line or second curve). bad names the first problem.
Attributes: pure
subroutine curve_words(words, series, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
words | character(len=*) | in | Words. | |
series | type(series_object) | inout | Filled curve series. | |
bad | character(len=:) | out | allocatable | Problem, empty if none. |
Call graph
spider_words
The spider plot style from gnuplot set style spiderplot words: fill style words (after an optional fs or fillstyle), lw|linewidth W, pt|pointtype N, ps|pointsize S. bad names the first problem.
subroutine spider_words(words, style, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
words | character(len=*) | in | Words. | |
style | type(style_object) | inout | Spider plot style. | |
bad | character(len=:) | out | allocatable | Problem, empty if none. |
Call graph
head_words
Arrowheads from gnuplot words: head (at the end), heads (both), nohead, backhead (at the start); filled, empty or nofilled (open). bad names an unknown word, empty if none.
Attributes: pure
subroutine head_words(words, head, filled, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
words | character(len=*) | in | Words. | |
head | integer(kind=I4P) | inout | Heads: 0 none, 1 end, 2 start, 3 both. | |
filled | logical | inout | Filled heads. | |
bad | character(len=:) | out | allocatable | Unknown word, empty if none. |
Call graph
label_words
Label options of series from gnuplot with labels words: left, center, right, rotate by A, norotate, offset X,Y [characters], point / nopoint, tc|textcolor [rgb] "color". bad names the first problem.
Attributes: pure
subroutine label_words(words, series, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
words | character(len=*) | in | Words. | |
series | type(series_object) | inout | Labels series. | |
bad | character(len=:) | out | allocatable | Problem, empty if none. |
Call graph
scan_word
Next blank separated word of text from pos, advanced past it; a quoted word may hold blanks. Empty at the end.
Attributes: pure
subroutine scan_word(text, pos, word)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
text | character(len=*) | in | Text. | |
pos | integer(kind=I4P) | inout | Scan position. | |
word | character(len=:) | out | allocatable | Word. |
Call graph
draw_parallel
A parallel axis plot in the box (left, right, top, bottom) [px], as gnuplot: a vertical axis per series at its number (or at), the x range one unit beyond the first and last, each axis scaled on its own (set paxis) and titled below by its series; a line per row across the axes, in the first series' style; the frame around.
subroutine draw_parallel(self, backend, box, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
box | real(kind=R8P) | in | Box: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
draw_spider
A spider plot in the box (left, right, top, bottom) [px], as gnuplot: a radial axis per series, the first up, the others clockwise, each scaled on its own (set paxis, the smallest value at the centre by default) and labelled outside by its series title, else by set paxis N label; the web (set grid spiderplot) at the ticks of axis 1; a polygon per row in its palette color and the spider plot style, named in the key by the key(N) column.
subroutine draw_spider(self, backend, box, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
box | real(kind=R8P) | in | Box: left, right, top, bottom [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
draw_colorbox
The color box: the palette gradient over the color axis (bottom to top), its frame, ticks, labels and label, between the plot area and the panel right side right.
subroutine draw_colorbox(self, backend, area, right, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | inout | Output device. | |
area | real(kind=R8P) | in | Plot area: left, right, top, bottom [px]. | |
right | real(kind=R8P) | in | Panel right side [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
setup_axes
Effective ranges and ticks for the plot area: x from every series, each y axis from its own series and the points inside the x range, as gnuplot. The second y axis is active when it has data or both its ends are fixed.
A polar panel sets up its r axis from the series as given (raw, theta:r), projects them into its series, and autoscales x and y to the disc of the largest radius, as gnuplot.
subroutine setup_axes(self, area, raw)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | inout | Panel. | |
area | real(kind=R8P) | in | Plot area: left, right, top, bottom [px]. | |
raw | type(series_object) | in | optional | Series of a polar panel, theta:r. |
Call graph
axes_names
Axes named by gnuplot's concatenated axis names, e.g. x, y2, xy, xyy2: each found one sets its flag (the others are left unchanged); bad is the first unsupported rest (x2 included), empty if none.
Attributes: pure
subroutine axes_names(names, x, y, y2, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
names | character(len=*) | in | Axis names. | |
x | logical | inout | x named. | |
y | logical | inout | y named. | |
y2 | logical | inout | y2 named. | |
bad | character(len=:) | out | allocatable | Unsupported rest, empty if none. |
Call graph
readout_position
Update the readout block position from the set key position words inside the plot area (see key_position): outside, below and above are not readout positions.
Attributes: pure
subroutine readout_position(words, horizontal, vertical, layout, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
words | character(len=*) | in | Blank separated words. | |
horizontal | character(len=6) | inout | Horizontal position. | |
vertical | character(len=6) | inout | Vertical position. | |
layout | logical | inout | Readouts side by side. | |
bad | character(len=:) | out | allocatable | First word not a position, empty if none. |
Call graph
key_position
Update the key position from gnuplot set key position words, applied in order: left, right, top, bottom, and center, which centres the direction not given yet by words (both if none, as gnuplot); inside, outside; below (under) and above (over), centred rows below or above the plot; horizontal, vertical the layout of the entries.
Attributes: pure
subroutine key_position(words, horizontal, vertical, outside, margin, layout, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
words | character(len=*) | in | Blank separated words. | |
horizontal | character(len=6) | inout | Horizontal position. | |
vertical | character(len=6) | inout | Vertical position. | |
outside | logical | inout | Outside the plot area. | |
margin | character(len=6) | inout | top, bottom or empty. | |
layout | logical | inout | Entries side by side. | |
bad | character(len=:) | out | allocatable | First word not a position, empty if none. |
Call graph
Functions
page_angle
Page angle of the theta theta [deg] (counterclockwise from the right) [rad], after set theta.
Attributes: elemental
Returns: real(kind=R8P)
function page_angle(self, theta) result(a)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
theta | real(kind=R8P) | in | Theta [deg]. |
Call graph
key_place
Where the key lies: inside the plot area, in the left or right margin, top (above the plot) or bottom (below it); outside and centred both ways it stays inside, as gnuplot.
Attributes: pure
Returns: character(len=6)
function key_place(self) result(place)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. |
Call graph
chart_key_width
Width of a chart key [px]: the widest entry, a gap, the sample.
Attributes: pure
Returns: real(kind=R8P)
function chart_key_width(backend, labels, font_size) result(width)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
backend | class(backend_object) | in | Output device. | |
labels | character(len=*) | in | Entries. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
polar_series
Whether series can be drawn on a polar panel (see POLAR_STYLES).
Attributes: elemental
Returns: logical
function polar_series(series) result(ok)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
series | type(series_object) | in | Series. |
Call graph
parallel_axis
The parallel axis k (set paxis k, else autoscaled without extension and without ticks) set up for the values of the k-th series, npx pixels long.
Returns: type(axis_object)
function parallel_axis(self, k, npx) result(axis)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
k | integer(kind=I4P) | in | Axis number. | |
npx | real(kind=R8P) | in | Axis length [px]. |
Call graph
is_panel_chart
Whether the style with is a chart alone in its panel, without the x and y axes: pie, gauge, radar, rose, and the parallel axis and spider plots.
Attributes: elemental
Returns: logical
function is_panel_chart(with) result(is)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
with | integer(kind=I4P) | in | Style code. |
Call graph
has_image
Whether the panel has an image; with palette true, an image of values colored by the palette (not RGB).
Attributes: pure
Returns: logical
function has_image(self, palette) result(has)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
palette | logical | in | optional | Palette images only. |
Call graph
any_image
Whether the series all hold an image, a palette one (not RGB) if palette. A module procedure on the series array, as image_range: gfortran 16 debug builds misread the components of self%series(s) through the class dummy.
Attributes: pure
Returns: logical
function any_image(all, palette) result(has)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
all | type(series_object) | in | Series of the panel. | |
palette | logical | in | Palette images only. |
Call graph
effective_palette
palette, or the palette of the theme if it has the default colors: from the dark glass to the emissive colors (vfd), from the pale glass to the dark segments (lcd), quantized as palette (maxcolors).
Returns: type(palette_object)
function effective_palette(palette, theme) result(p)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
palette | type(palette_object) | in | Panel palette. | |
theme | character(len=*) | in | Theme name. |
Call graph
is_readout
Whether the s-th series is a readout.
Attributes: elemental
Returns: logical
function is_readout(self, s) result(is)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
s | integer(kind=I4P) | in | Series index. |
Call graph
has_title
Whether the panel has a non-empty title.
Attributes: pure
Returns: logical
function has_title(self) result(has)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. |
Call graph
place_plot_area
Plot area left by the margins that tick labels, axis labels, title and a key above need, measured by the device.
Attributes: pure
Returns: real(kind=R8P)
function place_plot_area(self, backend, x0, y0, width, height, font_size, above) result(area)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | in | Output device, for text widths. | |
x0 | real(kind=R8P) | in | Box left side [px]. | |
y0 | real(kind=R8P) | in | Box top side [px]. | |
width | real(kind=R8P) | in | Box width [px]. | |
height | real(kind=R8P) | in | Box height [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. | |
above | real(kind=R8P) | in | Room for a key between the title and the plot [px]. |
Call graph
colorbox_width
Room of the color box at the right of the plot area: a gap, the box, a gap, its tick labels, the label [px].
Attributes: pure
Returns: real(kind=R8P)
function colorbox_width(self, backend, font_size) result(room)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(axes_object) | in | Panel. | |
backend | class(backend_object) | in | Output device, for text widths. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph