foresight_figure
foresight_figure, a figure: page, font and a grid of plot panels, driven by a gnuplot-like API.
Every method mirrors a gnuplot command (plot, set title, set xrange, set logscale, set multiplot, ...) so that the command line interpreter maps one-to-one onto this API. Settings and plots apply to the current panel; a figure has one panel unless set_multiplot lays out a grid, filled panel by panel with next_panel.
type(figure_object) :: fig
real(R8P) :: x(3), y(3)
x = [1.0_R8P, 2.0_R8P, 3.0_R8P]
y = x**2
call fig%set_title('parabola')
call fig%plot(x, y, title='x^2', with='linespoints')
call fig%save('parabola.svg')Source: src/lib/foresight_figure.F90
Dependencies
Contents
- figure_object
- clear
- rgbimage
- image
- init
- next_panel
- plot
- save
- set_cblabel
- set_cbrange
- set_colorbox
- set_palette
- set_angles
- set_border
- set_boxwidth
- set_style_fill
- set_style_histogram
- set_style_boxplot
- set_format
- set_paxis
- set_spiderplot
- set_style_spiderplot
- set_grid
- set_key
- set_logscale
- set_multiplot
- set_origin
- set_text
- set_polar
- set_raxis
- set_readout
- set_refresh
- set_rrange
- set_rtics
- set_size
- set_theme
- set_theta
- set_title
- set_trange
- set_ttics
- set_xlabel
- set_xrange
- set_xtics
- set_ylabel
- set_yrange
- set_ytics
- set_y2label
- set_y2range
- set_y2tics
- unset_logscale
- unset_multiplot
- unset_xtics
- unset_ytics
- unset_y2tics
- ensure_panels
- render
- set_tics
- which_axes
- extension
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
PAD | real(kind=R8P) | parameter | Outer padding [px]. |
GAP | real(kind=R8P) | parameter | Gap below the multiplot title [px]. |
LINE_HEIGHT | real(kind=R8P) | parameter | Text line height [font size]. |
Derived Types
figure_object
Figure.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
width | real(kind=R8P) | Page width [px], gnuplot svg terminal default. | |
height | real(kind=R8P) | Page height [px], gnuplot svg terminal default. | |
font_size | real(kind=R8P) | Font size [px]. | |
refresh | integer(kind=I4P) | HTML page reload period [s], 0 for none. | |
clear_screen | logical | Clear the terminal before text output (live view). | |
text_charset | character(len=9) | Text output: dumb characters, or the block | |
text_colors | character(len=7) | Text output colors: mono, ansi, ansi256, | |
theme | type(theme_object) | Output theme (foresight_theme), classic by default. | |
rows | integer(kind=I4P) | Panel grid rows. | |
cols | integer(kind=I4P) | Panel grid columns. | |
current | integer(kind=I4P) | Current panel, filled row by row. | |
layout | logical | Multiplot grid: panels in cells, else in their | |
manual | logical | Manual multiplot: panels added on demand. | |
title | character(len=:) | allocatable | Multiplot title, empty for none. |
panels | type(axes_object) | allocatable | Plot panels. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
clear | pass(self) | Remove the series of the current panel, keeping the settings. |
image | pass(self) | gnuplot plot ... with image, a grid of values. |
rgbimage | pass(self) | gnuplot plot ... with rgbimage|rgbalpha, a grid of colors. |
init | pass(self) | Reset the figure, optionally resizing it. |
next_panel | pass(self) | Move to the next multiplot panel, carrying the settings over. |
plot | pass(self) | gnuplot plot, one series per call. |
save | pass(self) | Render to a file; the format follows the extension. |
set_angles | pass(self) | gnuplot set angles. |
set_border | pass(self) | gnuplot set border / unset border. |
set_boxwidth | pass(self) | gnuplot set boxwidth. |
set_cblabel | pass(self) | gnuplot set cblabel. |
set_cbrange | pass(self) | gnuplot set cbrange. |
set_colorbox | pass(self) | gnuplot set colorbox / unset colorbox. |
set_format | pass(self) | gnuplot set format. |
set_grid | pass(self) | gnuplot set grid / unset grid. |
set_key | pass(self) | gnuplot set key / unset key. |
set_logscale | pass(self) | gnuplot set logscale. |
set_multiplot | pass(self) | gnuplot set multiplot layout rows,cols title "...". |
set_origin | pass(self) | gnuplot set origin. |
set_palette | pass(self) | gnuplot set palette. |
set_paxis | pass(self) | gnuplot set paxis N range|tics|label. |
set_polar | pass(self) | gnuplot set polar / unset polar. |
set_raxis | pass(self) | gnuplot set raxis / unset raxis. |
set_readout | pass(self) | Readouts: on/off, position, window, digit size. |
set_refresh | pass(self) | HTML page reload period, for live monitoring. |
set_rrange | pass(self) | gnuplot set rrange. |
set_rtics | pass(self) | gnuplot set rtics / unset rtics. |
set_size | pass(self) | gnuplot set size. |
set_style_fill | pass(self) | gnuplot set style fill. |
set_style_histogram | pass(self) | gnuplot set style histogram. |
set_style_boxplot | pass(self) | gnuplot set style boxplot. |
set_style_spiderplot | pass(self) | gnuplot set style spiderplot. |
set_spiderplot | pass(self) | gnuplot set spiderplot / unset spiderplot. |
set_text | pass(self) | Text output: gnuplot dumb or block terminal, colors. |
set_theme | pass(self) | Output theme: classic, vfd, lcd; glow. |
set_theta | pass(self) | gnuplot set theta. |
set_title | pass(self) | gnuplot set title. |
set_trange | pass(self) | gnuplot set trange. |
set_ttics | pass(self) | gnuplot set ttics / unset ttics. |
set_xlabel | pass(self) | gnuplot set xlabel. |
set_xrange | pass(self) | gnuplot set xrange. |
set_xtics | pass(self) | gnuplot set xtics. |
set_ylabel | pass(self) | gnuplot set ylabel. |
set_yrange | pass(self) | gnuplot set yrange. |
set_ytics | pass(self) | gnuplot set ytics. |
set_y2label | pass(self) | gnuplot set y2label. |
set_y2range | pass(self) | gnuplot set y2range. |
set_y2tics | pass(self) | gnuplot set y2tics. |
unset_logscale | pass(self) | gnuplot unset logscale. |
unset_multiplot | pass(self) | gnuplot unset multiplot. |
unset_xtics | pass(self) | gnuplot unset xtics. |
unset_ytics | pass(self) | gnuplot unset ytics. |
unset_y2tics | pass(self) | gnuplot unset y2tics. |
ensure_panels | pass(self) | Allocate the single default panel if needed. |
render | pass(self) | Render on a device. |
Subroutines
clear
Remove the series of the current panel, keeping every setting: a new gnuplot plot replaces the previous one.
subroutine clear(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. |
Call graph
rgbimage
Image of the colors red, green, blue (and alpha, opaque if absent) per pixel (column, row), 0 to 255, as gnuplot plot ... with rgbimage (rgbalpha): pixel centres x(column), y(row) as image; a NaN component makes its pixel transparent. No palette nor color box.
subroutine rgbimage(self, red, green, blue, x, y, title, alpha)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
red | real(kind=R8P) | in | Red components (column, row), rows upward. | |
green | real(kind=R8P) | in | Green components. | |
blue | real(kind=R8P) | in | Blue components. | |
x | real(kind=R8P) | in | optional | Pixel centre abscissae. |
y | real(kind=R8P) | in | optional | Pixel centre ordinates. |
title | character(len=*) | in | optional | Key title. |
alpha | real(kind=R8P) | in | optional | Opacities, 0 (transparent) to 255. |
Call graph
image
Image of the values z(column, row) (a heatmap), as gnuplot plot ... with image: pixel centres x(column) and y(row), evenly spaced and increasing (0, 1, ... if absent, as gnuplot matrix), colored by set_palette over set_cbrange; NaN values are transparent. The x and y axes fit the pixel edges.
subroutine image(self, z, x, y, title)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
z | real(kind=R8P) | in | Values (column, row), rows upward. | |
x | real(kind=R8P) | in | optional | Pixel centre abscissae. |
y | real(kind=R8P) | in | optional | Pixel centre ordinates. |
title | character(len=*) | in | optional | Key title. |
Call graph
init
Reset the figure to gnuplot defaults, optionally resizing it.
subroutine init(self, width, height, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
width | integer(kind=I4P) | in | optional | Page width [px]. |
height | integer(kind=I4P) | in | optional | Page height [px]. |
font_size | real(kind=R8P) | in | optional | Font size [px]. |
Call graph
next_panel
Move to the next panel of the multiplot: the next grid cell, or a new panel in a manual multiplot; the settings of the current panel carry over, as in gnuplot.
subroutine next_panel(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. |
Call graph
plot
Add the series (x, y) to the current panel, as gnuplot plot ... title ... with ... lc ... lw ... dt ... ps ... axes.
Error bar styles (yerrorbars, xerrorbars, xyerrorbars) take the bar bounds ylow/yhigh, xlow/xhigh. axes='x1y2' plots the series against the second y axis, scaled on its own. pt is gnuplot's point type (0 a dot, 1 plus, 2 cross, 3 star, 4-5 square, 6-7 circle, 8-9 triangle, 10-11 inverted triangle, 12-13 diamond, 14-15 pentagon, odd ones from 5 filled; cycling every 15), 9 px wide at ps 1; without it points are round dots.
with='readout' (a foresight extension) shows the last finite y in seven-segment digits, titled by title, on a glass of format (a printf conversion with a field width, '%9.2e'; '%10.3e' if absent): see foresight_readout and set_readout. A readout takes lc only among the style options.
with='boxes' draws a bar from y = 0 to each y, width wide (per box; NaN or absent: set_boxwidth, else the boxes touch); with='filledcurves' fills down to base, between ylow and y, or the closed polygon of the points. fs takes gnuplot fill style words ('solid 0.5 noborder'), over set_style_fill.
with='histograms' draws a bar per y in the row at x (0, 1, 2, ... as gnuplot), laid out with the other histograms of the panel by set_style_histogram. xlabels label the abscissae (gnuplot xtic(N)): text labels then replace the x ticks.
with='circles' draws a circle per point, radius in x units (2% of the plot width if absent or NaN), a wedge with angles(:, i) = start and end [deg, counterclockwise from the x direction]. with='pie' (a foresight extension, alone in its panel) draws the y as slices from 12 o'clock clockwise, labelled by xlabels with their percentage in the key; donut (0 to below 1) leaves a hole of that fraction of the radius.
Panel charts (foresight extensions, alone in their panel, several of the same kind side by side for gauges and radars): with='gauge' shows the last finite y on a 270-degree sweep over scale (its two end values), lit in fs='segments N' cells if set, the value in digits of format; with='radar' a polygon over a spoke per point, named by xlabels; with='rose' equal sectors of area by value (radius by value with linear).
with='boxerrorbars' draws boxes (as boxes) with y error bars from ylow to yhigh; boxxyerror a rectangle from xlow to xhigh, ylow to yhigh; candlesticks and financebars take the open y, low ylow, high yhigh and close (a box-and-whisker plot: box start, whisker ends, box end), candlesticks a width and whiskerbars (crossbars, a fraction of the box width). with='boxplot' draws the quartiles, median, whiskers and outliers of the values y at x(1), one box per level of factors if given, laid out by set_style_boxplot.
with='vectors' draws arrows from the points by dx, dy; arrows by length (> 0 x units, kept at any angle; in (-1, 0) a fraction of the plot width) and angle [deg]; head takes gnuplot's words ('heads filled'). ellipses take major, minor diameters (x and y units) and angle [deg]; polygons fill each NaN-separated run of points; labels write labels(i) at the points with the label words ('left offset 1,0 point'); sectors draw the annular sectors from azimuth x, radius y by angle (the angle unit) and width.
subroutine plot(self, x, y, title, with, lc, lw, dt, ps, xlow, xhigh, ylow, yhigh, axes, pt, format, width, base, fs, xlabels, radius, angles, donut, scale, linear, close, whiskerbars, factors, dx, dy, length, angle, major, minor, labels, label, head, origins, curve, at)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
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, .... |
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 (default) or x1y2. |
pt | integer(kind=I4P) | in | optional | gnuplot point type, >= 0. |
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. |
radius | real(kind=R8P) | in | optional | Circle radii [x units]. |
angles | real(kind=R8P) | in | optional | Wedge angles (2, point) [deg]. |
donut | real(kind=R8P) | in | optional | Pie hole fraction. |
scale | real(kind=R8P) | in | optional | Gauge scale: the values at the sweep ends. |
linear | logical | in | optional | Rose radius by value. |
close | real(kind=R8P) | in | optional | Closing values of candlesticks and finance bars. |
whiskerbars | real(kind=R8P) | in | optional | Candlestick whisker crossbars, a box width fraction. |
factors | character(len=*) | in | optional | Factor level of each boxplot value. |
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. |
angle | real(kind=R8P) | in | optional | Arrow or ellipse angles [deg], sector extents. |
major | real(kind=R8P) | in | optional | Ellipse major diameters. |
minor | real(kind=R8P) | in | optional | Ellipse minor diameters. |
labels | character(len=*) | in | optional | Texts of labels. |
label | character(len=*) | in | optional | Label option words. |
head | character(len=*) | in | optional | Arrowhead words. |
origins | real(kind=R8P) | in | optional | Sector centres (2, point). |
curve | character(len=*) | in | optional | Filled curve options ('x1', 'above', 'xy=0,1'). |
at | real(kind=R8P) | in | optional | Position of a parallel axis. |
Call graph
save
Render the figure to file; the format follows the name: .svg static, .html interactive, .txt text (the gnuplot dumb or block terminal, see set_text), - text on standard output.
subroutine save(self, file)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
file | character(len=*) | in | Output file. |
Call graph
set_cblabel
Color box label, as gnuplot set cblabel; empty for none.
subroutine set_cblabel(self, label)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
label | character(len=*) | in | Label. |
Call graph
set_cbrange
Color range of the images, as gnuplot set cbrange [min:max]: an absent end is autoscaled to the values.
subroutine set_cbrange(self, min, max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
min | real(kind=R8P) | in | optional | Value of the first palette color. |
max | real(kind=R8P) | in | optional | Value of the last palette color. |
Call graph
set_colorbox
Draw the color box of the images (on absent or true), as gnuplot set colorbox, or not.
subroutine set_colorbox(self, on)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
on | logical | in | optional | Color box on. |
Call graph
set_palette
Palette of the images, as gnuplot set palette: '' (the default, rgbformulae 7,5,15), 'rgbformulae 33,13,10', 'defined (0 "blue", 1 "white", 2 "red")', 'gray', 'viridis', 'negative', 'maxcolors 8'.
subroutine set_palette(self, words)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
words | character(len=*) | in | Palette words. |
Call graph
set_angles
Unit of the angles, as gnuplot set angles degrees|radians (radians by default): theta of a polar panel and the trigonometric functions of its expressions (set_angles affects the script interpreter's compilation).
subroutine set_angles(self, unit)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
unit | character(len=*) | in | degrees or radians. |
Call graph
set_border
Border sides, as gnuplot set border MASK [polar] (unset border is mask 0): 1 bottom, 2 left, 4 top, 8 right (31 by default, the full frame); polar adds the circle of the largest r on a polar panel. Without mask, polar keeps the sides (gnuplot: unset border; set border polar draws the circle alone), else the full frame is restored.
subroutine set_border(self, mask, polar)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
mask | integer(kind=I4P) | in | optional | Sides; 31 if absent. |
polar | logical | in | optional | Polar border. |
Call graph
set_boxwidth
Box width, as gnuplot set boxwidth W [absolute|relative]: width absent or 0 for the default, the boxes touching; relative scales that default instead of setting the width.
subroutine set_boxwidth(self, width, relative)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
width | real(kind=R8P) | in | optional | Width, or fraction of the default with relative. |
relative | logical | in | optional | Relative width. |
Call graph
set_style_fill
Fill of the boxes and filled curves plotted next, as gnuplot set style fill: 'empty', 'solid 0.5', 'transparent solid 0.3 noborder', 'solid border lc "black"'.
subroutine set_style_fill(self, words)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
words | character(len=*) | in | Fill style words. |
Call graph
set_style_histogram
Layout of the histograms plotted next, as gnuplot set style histogram clustered [gap G]|rowstacked: styleclustered (the default) or rowstacked; gap the space between clusters, in bar widths (2 by default).
subroutine set_style_histogram(self, style, gap)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
style | character(len=*) | in | clustered or rowstacked. | |
gap | real(kind=R8P) | in | optional | Gap between clusters [bars]. |
Call graph
set_style_boxplot
Layout of the boxplots plotted next, as gnuplot set style boxplot: words among range R (1.5), fraction F, outliers (the default) or nooutliers, pointtype P (7), candlesticks (the default) or financebars, medianlinewidth W, separation S (1), labels off|auto|x, sorted or unsorted (the default).
subroutine set_style_boxplot(self, words)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
words | character(len=*) | in | Style words. |
Call graph
set_format
Tick label format of the axes named x, y, y2 (all when absent), as gnuplot set format: text with one printf conversion %[flags][width][.precision] f, e, E, g, G or h (g with a x10 superscript exponent), e.g. '%.1e' or '%g s'; an empty format restores the default labels.
subroutine set_format(self, format, axes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
format | character(len=*) | in | Label format. | |
axes | character(len=*) | in | optional | Axes names, e.g. y, xy or y2. |
Call graph
set_paxis
Parallel axis n of the parallel axis and spider plots, as gnuplot set paxis n range [min:max] (an absent end autoscaled to the values, without extension), set paxis n tics [START,]STEP[,END] (tics true: automatic ticks; false: none, the default), set paxis n label "text" (spider plots).
subroutine set_paxis(self, n, min, max, step, start, end, tics, label)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
n | integer(kind=I4P) | in | Axis number, >= 1. | |
min | real(kind=R8P) | in | optional | Range start. |
max | real(kind=R8P) | in | optional | Range end. |
step | real(kind=R8P) | in | optional | Tick step. |
start | real(kind=R8P) | in | optional | First tick. |
end | real(kind=R8P) | in | optional | Last tick. |
tics | logical | in | optional | Ticks on (automatic) or off. |
label | character(len=*) | in | optional | Axis label. |
Call graph
set_spiderplot
Spider plot coordinates (on absent or true), as gnuplot set spiderplot: the items of the panel are spider plot axes (its data style), its key not titled by the items; false restores the data style lines.
subroutine set_spiderplot(self, on)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
on | logical | in | optional | Spider plot on. |
Call graph
set_style_spiderplot
Polygons of the spider plots plotted next, as gnuplot set style spiderplot: fill style words ('fs transparent solid 0.2 border', fs optional) and lw W, pt N, ps S.
subroutine set_style_spiderplot(self, words)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
words | character(len=*) | in | Style words. |
Call graph
set_grid
Draw grid lines at the major ticks (on absent or true), as gnuplot set grid, or not. On a polar panel, polar > 0 draws the polar grid instead (gnuplot set grid polar STEP): rings at the major r ticks and spokes every polar degrees of theta; 0 restores the rectangular grid. spider draws the web of the spider plots (gnuplot set grid spiderplot) at the ticks of their first axis.
subroutine set_grid(self, on, polar, spider)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
on | logical | in | optional | Grid on. |
polar | real(kind=R8P) | in | optional | Spoke step [deg], 0 for the rectangular grid. |
spider | logical | in | optional | Spider plot web. |
Call graph
set_key
Draw the key (on absent or true), as gnuplot set key, or not; position takes gnuplot's words, e.g. 'bottom left', 'center' (inside the plot area, top right by default), 'outside', 'below', 'above', 'horizontal'; box draws a box around it.
subroutine set_key(self, on, position, box)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
on | logical | in | optional | Key on. |
position | character(len=*) | in | optional | Position words: left, right, center, top, bottom. |
box | logical | in | optional | Box around the key. |
Call graph
set_logscale
Base-10 log scale on the axes named x, y, y2; all axes when absent, as gnuplot.
subroutine set_logscale(self, axes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
axes | character(len=*) | in | optional | Axes names, e.g. y, xy or y2. |
Call graph
set_multiplot
Lay out a rows x cols grid of panels, filled row by row starting from the first; every panel starts from the settings of the current one, without its series. Without rows and cols, a manual multiplot: each panel lies in its set_origin/set_size box, as gnuplot set multiplot without layout.
subroutine set_multiplot(self, rows, cols, title)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
rows | integer(kind=I4P) | in | optional | Grid rows. |
cols | integer(kind=I4P) | in | optional | Grid columns. |
title | character(len=*) | in | optional | Multiplot title. |
Call graph
set_origin
Bottom left corner of the plot as page fractions, as gnuplot set origin x,y: for a single plot and the panels of a manual multiplot (not with a layout).
subroutine set_origin(self, x, y)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
x | real(kind=R8P) | in | Left side, page width fraction. | |
y | real(kind=R8P) | in | Bottom side, page height fraction. |
Call graph
set_text
Text output (.txt, -): charset dumb (default), drawing with characters, or the gnuplot block character set half, quadrants, sextants, braille; colors mono (default), ansi, ansi256 or ansirgb, the series in ANSI colors. Absent arguments keep their setting.
subroutine set_text(self, charset, colors)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
charset | character(len=*) | in | optional | Character set. |
colors | character(len=*) | in | optional | Color mode. |
Call graph
set_polar
Polar coordinates (on absent or true), as gnuplot set polar: the series of the panel are theta:r (theta in set_angles units, from the set_theta origin), drawn at x = (r - rmin) cos(theta), y = (r - rmin) sin(theta) joined by straight segments; x and y autoscale to the disc of the largest r. The frame stays rectangular, as gnuplot: a round plot sets the polar border, the polar grid, the square size and turns the x and y ticks off.
subroutine set_polar(self, on)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
on | logical | in | optional | Polar on. |
Call graph
set_raxis
Draw the radial axis of a polar panel (on absent or true; the default), as gnuplot set raxis, or not.
subroutine set_raxis(self, on)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
on | logical | in | optional | Axis on. |
Call graph
set_readout
Draw the readouts (on absent or true) or not; position takes the set key words inside the plot area (left, right, center, top, bottom; top left by default) and horizontal or vertical (the default) for a row or a column of readouts; opaque draws a window behind them (default true); size is the digit height [px], 0 for the default (2.5 font sizes, growing to fill a panel of readouts alone).
subroutine set_readout(self, on, position, opaque, size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
on | logical | in | optional | Readouts on. |
position | character(len=*) | in | optional | Position words. |
opaque | logical | in | optional | Window behind the readouts. |
size | real(kind=R8P) | in | optional | Digit height [px]. |
Call graph
set_refresh
Make the HTML page reload itself every seconds (0 disables): live view of a file rewritten by a running job.
The zoom survives the reload, being kept in the page URL as data values.
Attributes: pure
subroutine set_refresh(self, seconds)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
seconds | integer(kind=I4P) | in | Reload period [s]. |
Call graph
set_rrange
r range of a polar panel, as gnuplot set rrange [min:max]: min lies at the pole (0 when absent), the points below it are undefined; an absent max autoscales to the largest |r|, extended to the r ticks.
subroutine set_rrange(self, min, max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
min | real(kind=R8P) | in | optional | r at the pole. |
max | real(kind=R8P) | in | optional | Largest r. |
Call graph
set_rtics
r ticks of a polar panel every step from start to end, automatic without step (the default), as gnuplot set rtics; on false turns them off (unset rtics).
subroutine set_rtics(self, step, start, end, on)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
step | real(kind=R8P) | in | optional | Tick step. |
start | real(kind=R8P) | in | optional | First tick. |
end | real(kind=R8P) | in | optional | Last tick. |
on | logical | in | optional | Ticks on. |
Call graph
set_size
Size of the plot as page fractions, as gnuplot set size w,h: for a single plot and the panels of a manual multiplot (not with a layout). ratio > 0 fixes the plot area height over width (gnuplot set size ratio R, square is 1), 0 frees it (noratio).
subroutine set_size(self, width, height, ratio)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
width | real(kind=R8P) | in | optional | Width, page width fraction, > 0. |
height | real(kind=R8P) | in | optional | Height, page height fraction, > 0. |
ratio | real(kind=R8P) | in | optional | Plot area height over width, 0 for none. |
Call graph
set_theme
Output theme (a foresight extension): name classic (the default), vfd (a vacuum fluorescent display: black glass, emissive colors, glowing data) or lcd (a backlit liquid crystal display); glow overrides the theme's glow (on in vfd). Text output takes the theme colors of the series only (ansi colors).
subroutine set_theme(self, name, glow)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
name | character(len=*) | in | optional | Theme name. |
glow | logical | in | optional | Glowing data. |
Call graph
set_theta
Where theta = 0 lies on a polar panel, right (the default), top, left or bottom, and whether theta grows clockwise (default counterclockwise), as gnuplot set theta.
subroutine set_theta(self, origin, clockwise)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
origin | character(len=*) | in | optional | Direction of theta = 0. |
clockwise | logical | in | optional | Theta grows clockwise. |
Call graph
set_title
Set the title of the current panel, empty for none.
subroutine set_title(self, title)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
title | character(len=*) | in | Title. |
Call graph
set_trange
Angle range the script functions of a polar panel are sampled over, as gnuplot set trange [min:max] (in set_angles units; a full turn from 0 when absent).
subroutine set_trange(self, min, max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
min | real(kind=R8P) | in | optional | First angle. |
max | real(kind=R8P) | in | optional | Last angle. |
Call graph
set_ttics
Theta labels of a polar panel outside its largest r, every step degrees from start (0), whatever the angle unit, as gnuplot set ttics START,STEP; every 45 degrees without step (gnuplot draws none); format the label format; on false turns them off (the default, unset ttics).
subroutine set_ttics(self, step, start, format, on)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
step | real(kind=R8P) | in | optional | Label step [deg]. |
start | real(kind=R8P) | in | optional | First label [deg]. |
format | character(len=*) | in | optional | Label format. |
on | logical | in | optional | Labels on. |
Call graph
set_xlabel
Set the x axis label of the current panel, empty for none.
subroutine set_xlabel(self, label)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
label | character(len=*) | in | Label. |
Call graph
set_xrange
Set the x range as gnuplot set xrange [min:max]: an absent end is autoscaled, min > max reverses the axis.
subroutine set_xrange(self, min, max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
min | real(kind=R8P) | in | optional | Value at the axis start. |
max | real(kind=R8P) | in | optional | Value at the axis end. |
Call graph
set_xtics
x ticks every step from start to end (both optional), as gnuplot set xtics START,STEP,END; automatic without step. On a log axis the step is a factor (> 1): ticks at start * step**k. mirror false draws them on the bottom border only (gnuplot nomirror).
subroutine set_xtics(self, step, start, end, mirror)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
step | real(kind=R8P) | in | optional | Tick step, a factor on log axes. |
start | real(kind=R8P) | in | optional | First tick. |
end | real(kind=R8P) | in | optional | Last tick. |
mirror | logical | in | optional | Ticks also on the top border. |
Call graph
set_ylabel
Set the y axis label of the current panel, empty for none.
subroutine set_ylabel(self, label)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
label | character(len=*) | in | Label. |
Call graph
set_yrange
Set the y range as gnuplot set yrange [min:max]: an absent end is autoscaled, min > max reverses the axis.
subroutine set_yrange(self, min, max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
min | real(kind=R8P) | in | optional | Value at the axis start. |
max | real(kind=R8P) | in | optional | Value at the axis end. |
Call graph
set_ytics
y ticks every step from start to end (both optional), as gnuplot set ytics START,STEP,END; automatic without step. On a log axis the step is a factor (> 1): ticks at start * step**k. mirror false draws them on the left border only (gnuplot nomirror), leaving the right one to the second y axis.
subroutine set_ytics(self, step, start, end, mirror)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
step | real(kind=R8P) | in | optional | Tick step, a factor on log axes. |
start | real(kind=R8P) | in | optional | First tick. |
end | real(kind=R8P) | in | optional | Last tick. |
mirror | logical | in | optional | Ticks also on the right border. |
Call graph
set_y2label
Set the second y axis label of the current panel, on the right, empty for none.
subroutine set_y2label(self, label)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
label | character(len=*) | in | Label. |
Call graph
set_y2range
Set the second y axis range as gnuplot set y2range [min:max]: an absent end is autoscaled on the x1y2 series.
subroutine set_y2range(self, min, max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
min | real(kind=R8P) | in | optional | Value at the axis start. |
max | real(kind=R8P) | in | optional | Value at the axis end. |
Call graph
set_y2tics
Ticks and labels of the second y axis on the right border, as gnuplot set y2tics START,STEP,END (automatic without step); off by default, as in gnuplot. mirror true draws the ticks on the left border too.
subroutine set_y2tics(self, step, start, end, mirror)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
step | real(kind=R8P) | in | optional | Tick step, a factor on log axes. |
start | real(kind=R8P) | in | optional | First tick. |
end | real(kind=R8P) | in | optional | Last tick. |
mirror | logical | in | optional | Ticks also on the left border. |
Call graph
unset_logscale
Linear scale on the axes named x, y, y2; all axes when absent, as gnuplot.
subroutine unset_logscale(self, axes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
axes | character(len=*) | in | optional | Axes names, e.g. y, xy or y2. |
Call graph
unset_multiplot
Back to a single panel, keeping the settings of the current one without its series.
subroutine unset_multiplot(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. |
Call graph
unset_xtics
No x ticks, tick labels nor grid lines, as gnuplot unset xtics; autoscaled ends are then not extended.
subroutine unset_xtics(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. |
Call graph
unset_ytics
No y ticks, tick labels nor grid lines, as gnuplot unset ytics; autoscaled ends are then not extended.
subroutine unset_ytics(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. |
Call graph
unset_y2tics
No second y axis ticks nor tick labels, the default, as gnuplot unset y2tics.
subroutine unset_y2tics(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. |
Call graph
ensure_panels
Allocate the single default panel of a fresh figure.
subroutine ensure_panels(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. |
Call graph
render
Render the figure on backend, writing file: the multiplot title on top, panels in grid cells of a layout or else in their origin/size boxes; in a multiplot the panels never plotted stay blank, as in gnuplot.
subroutine render(self, backend, file)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(figure_object) | inout | Figure. | |
backend | class(backend_object) | inout | Output device. | |
file | character(len=*) | in | Output file. |
Call graph
set_tics
Fixed ticks from real settings, or automatic ones without step; invalid settings stop. mirror alone (no step, start, end) keeps the tick positions, as gnuplot set xtics nomirror, turning off ticks on at their last positions.
subroutine set_tics(tics, caller, step, start, end, mirror)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
tics | type(tics_object) | inout | Axis tick settings. | |
caller | character(len=*) | in | Procedure name, for messages. | |
step | real(kind=R8P) | in | optional | Tick step. |
start | real(kind=R8P) | in | optional | First tick. |
end | real(kind=R8P) | in | optional | Last tick. |
mirror | logical | in | optional | Ticks also on the opposite border. |
Call graph
Functions
which_axes
Axes named in axes (x, y, y2, concatenated), all when absent; unsupported names stop.
Returns: logical
function which_axes(axes, caller) result(named)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
axes | character(len=*) | in | optional | Axes names. |
caller | character(len=*) | in | Procedure name, for messages. |
Call graph
extension
Lower case extension of file, empty if none.
Attributes: pure
Returns: character(len=:)
function extension(file) result(ext)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
file | character(len=*) | in | File name. |
Call graph