foresight_style
foresight_style, series drawing style (gnuplot
with,lc,lw,dt,pt,ps,fs).
Filled styles (boxes, filledcurves) take gnuplot's fill style: empty (the default, the border only), solid D (the line color at opacity D, 1 by default; transparent before it changes nothing in SVG, as gnuplot's svg terminal), with a border in the line color, another color (border lc "c", border -1 black) or noborder. foresight adds segments N (boxes and histograms): the y range cut into N cells, a bar lighting the cells it covers at least half, the others drawn faintly, as the bar graphs of a 1980s display.
Source: src/lib/foresight_style.F90
Dependencies
Contents
- style_object
- sequence_colors
- pattern_parts
- fill_style
- default_color
- custom_dashtype
- style_name
- gnuplot_abbreviates
- style_with
- dasharray
- draws_lines
- draws_points
- draws_xbars
- draws_ybars
- fills
- fill_color
- stroke_color
- point_diameter
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
CUSTOM_DASH_BASE | integer(kind=I4P) | parameter | Dash types above it are custom patterns (custom_dashtype). |
MAX_CUSTOM_DASHES | integer(kind=I4P) | parameter | Custom dash patterns kept. |
custom_dashes | character(len=160) | save | Patterns. |
custom_dash_count | integer(kind=I4P) | save | Patterns kept. |
WITH_LINES | integer(kind=I4P) | parameter | gnuplot with lines. |
WITH_POINTS | integer(kind=I4P) | parameter | gnuplot with points. |
WITH_LINESPOINTS | integer(kind=I4P) | parameter | gnuplot with linespoints. |
WITH_YERRORBARS | integer(kind=I4P) | parameter | gnuplot with yerrorbars. |
WITH_XERRORBARS | integer(kind=I4P) | parameter | gnuplot with xerrorbars. |
WITH_XYERRORBARS | integer(kind=I4P) | parameter | gnuplot with xyerrorbars. |
WITH_READOUT | integer(kind=I4P) | parameter | foresight with readout: the last value in seven-segment digits. |
WITH_BOXES | integer(kind=I4P) | parameter | gnuplot with boxes. |
WITH_FILLEDCURVES | integer(kind=I4P) | parameter | gnuplot with filledcurves. |
WITH_HISTOGRAMS | integer(kind=I4P) | parameter | gnuplot with histograms. |
WITH_IMAGE | integer(kind=I4P) | parameter | gnuplot with image. |
WITH_CIRCLES | integer(kind=I4P) | parameter | gnuplot with circles: circles and wedges. |
WITH_PIE | integer(kind=I4P) | parameter | foresight with pie: a pie or donut chart. |
WITH_GAUGE | integer(kind=I4P) | parameter | foresight with gauge: the last value on a sweep gauge. |
WITH_RADAR | integer(kind=I4P) | parameter | foresight with radar: a polygon over the spokes of the rows. |
WITH_ROSE | integer(kind=I4P) | parameter | foresight with rose: equal sectors, area or radius by value. |
WITH_IMPULSES | integer(kind=I4P) | parameter | gnuplot with impulses: a segment from y = 0 to each point. |
WITH_STEPS | integer(kind=I4P) | parameter | gnuplot with steps: horizontal, then vertical. |
WITH_FSTEPS | integer(kind=I4P) | parameter | gnuplot with fsteps: vertical, then horizontal. |
WITH_HISTEPS | integer(kind=I4P) | parameter | gnuplot with histeps: steps around the points, from y = 0. |
WITH_DOTS | integer(kind=I4P) | parameter | gnuplot with dots: a tiny dot per point. |
WITH_YERRORLINES | integer(kind=I4P) | parameter | gnuplot with yerrorlines: linespoints and y error bars. |
WITH_XERRORLINES | integer(kind=I4P) | parameter | gnuplot with xerrorlines: linespoints and x error bars. |
WITH_XYERRORLINES | integer(kind=I4P) | parameter | gnuplot with xyerrorlines: linespoints and both bars. |
WITH_BOXERRORBARS | integer(kind=I4P) | parameter | gnuplot with boxerrorbars: boxes with y error bars. |
WITH_BOXXYERROR | integer(kind=I4P) | parameter | gnuplot with boxxyerror: a rectangle per point. |
WITH_CANDLESTICKS | integer(kind=I4P) | parameter | gnuplot with candlesticks: box and whiskers. |
WITH_FINANCEBARS | integer(kind=I4P) | parameter | gnuplot with financebars: high-low bars, open/close ticks. |
WITH_BOXPLOT | integer(kind=I4P) | parameter | gnuplot with boxplot: quartiles of the values, outliers. |
WITH_VECTORS | integer(kind=I4P) | parameter | gnuplot with vectors: arrows from x:y by dx:dy. |
WITH_ARROWS | integer(kind=I4P) | parameter | gnuplot with arrows: arrows from x:y by length and angle. |
WITH_ELLIPSES | integer(kind=I4P) | parameter | gnuplot with ellipses: an ellipse per point. |
WITH_POLYGONS | integer(kind=I4P) | parameter | gnuplot with polygons: a closed polygon per block. |
WITH_LABELS | integer(kind=I4P) | parameter | gnuplot with labels: text at each point. |
WITH_SECTORS | integer(kind=I4P) | parameter | gnuplot with sectors: annular sectors. |
WITH_PARALLELAXES | integer(kind=I4P) | parameter | gnuplot with parallelaxes: an axis per item, a line per row. |
WITH_SPIDERPLOT | integer(kind=I4P) | parameter | gnuplot with spiderplot: a radial axis per item, a polygon per row. |
WITH_FILLSTEPS | integer(kind=I4P) | parameter | gnuplot with fillsteps: the area under steps filled. |
WITH_PM3D | integer(kind=I4P) | parameter | gnuplot with pm3d (splot): a surface as colored quadrangles. |
WITH_MASK | integer(kind=I4P) | parameter | gnuplot with mask: polygons masking the mask items, not drawn. |
STYLE_NAMES | character(len=*) | parameter | Supported style names. |
FILL_EMPTY | integer(kind=I4P) | parameter | gnuplot set style fill empty: no fill. |
FILL_SOLID | integer(kind=I4P) | parameter | gnuplot set style fill solid. |
FILL_PATTERN | integer(kind=I4P) | parameter | gnuplot set style fill pattern N. |
PATTERNS | integer(kind=I4P) | parameter | Fill patterns of gnuplot's svg terminal, cycling: 0 empty, 1 crosshatch, 2 dense crosshatch, 3 solid, 4 and 7 lines down, 5 and 6 lines up (6, 7 steeper). |
PALETTE | character(len=7) | parameter | gnuplot 5 line colors. |
DIAMETER_AT_UNIT_SIZE | real(kind=R8P) | parameter | Round dot diameter at pointsize 1 [px]. |
MARKER_AT_UNIT_SIZE | real(kind=R8P) | parameter | Point type size at pointsize 1 [px], gnuplot svg. |
Derived Types
style_object
Series drawing style.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
with | integer(kind=I4P) | Plotting style. | |
color | character(len=:) | allocatable | Line and point color (SVG color). |
linewidth | real(kind=R8P) | Line width [px]. | |
dashtype | integer(kind=I4P) | gnuplot dash type: 1 solid, 2..5 dash patterns. | |
pointsize | real(kind=R8P) | Point size scale factor. | |
pointtype | integer(kind=I4P) | gnuplot point type: 0 a dot, 1.. the shapes (cycling every 15); negative for foresight's round dot. | |
fill | integer(kind=I4P) | Fill of filled styles. | |
density | real(kind=R8P) | Fill opacity, solid fills. | |
border | logical | Border of filled styles. | |
border_color | character(len=:) | allocatable | Border color, empty for the line color. |
segments | integer(kind=I4P) | Cells over the y range of a segmented fill, 0 for none. | |
pattern | integer(kind=I4P) | Fill pattern (FILL_PATTERN), cycling every PATTERNS. | |
fill_rgb | character(len=:) | allocatable | Fill color (gnuplot fc), empty or unallocated for the line color. |
point_char | character(len=:) | allocatable | A character as the point (gnuplot pt "c"), drawn in place of the point type when allocated and not empty. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
dasharray | pass(self) | SVG dash array. |
draws_xbars | pass(self) | Whether horizontal error bars are drawn. |
fills | pass(self) | Whether the style is a filled one. |
fill_color | pass(self) | Fill color, none if empty. |
stroke_color | pass(self) | Border color of a filled style, none if no border. |
draws_ybars | pass(self) | Whether vertical error bars are drawn. |
draws_lines | pass(self) | Whether lines are drawn. |
draws_points | pass(self) | Whether points are drawn. |
point_diameter | pass(self) | Point diameter [px]. |
Subroutines
sequence_colors
Colors of the sequence name, as gnuplot set colorsequence: default (gnuplot 5's, returned empty: the default), podo (8 colors) or classic (gnuplot's svg terminal, 13 colors); beyond gnuplot, a categorical order of foresight_colormaps (batlowS, ..., any case), its first n colors (8 if n < 1), the most distinct first.
Attributes: pure
subroutine sequence_colors(name, n, colors, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
name | character(len=*) | in | Sequence name. | |
n | integer(kind=I4P) | in | Colors of a categorical order; < 1 for 8. | |
colors | character(len=9) | out | allocatable | Colors, #rrggbb; empty for gnuplot's default. |
bad | character(len=:) | out | allocatable | Why not, empty if done. |
Call graph
pattern_parts
The pattern (1 to PATTERNS - 1) and color of a pattern fill pattern:N:color (fill_color); pattern 0 and color the fill itself for any other fill.
Attributes: pure
subroutine pattern_parts(fill, pattern, color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
fill | character(len=*) | in | Fill color. | |
pattern | integer(kind=I4P) | out | Pattern, 0 for none. | |
color | character(len=:) | out | allocatable | Color. |
Call graph
fill_style
Update the fill of style from gnuplot fill style words, blank separated: empty, solid [D], transparent solid [D], border [lc [rgb] COLOR | lt N | -1] (COLOR quoted or not), noborder (abbreviated as gnuplot: s, bo, nobo, ...), and foresight's segments N (N from 1 to 1000; segments 0 for none); bad is the first word not understood.
subroutine fill_style(words, style, bad)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
words | character(len=*) | in | Fill style words. | |
style | type(style_object) | inout | Style updated. | |
bad | character(len=:) | out | allocatable | First word not understood, empty if none. |
Call graph
Functions
default_color
Color of linetype index, cycling the active sequence colors (set colorsequence), else gnuplot 5's linetype colors.
Attributes: pure
Returns: character(len=:)
function default_color(index, colors) result(color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
index | integer(kind=I4P) | in | Series index, from 1. | |
colors | character(len=9) | in | optional | Active color sequence; absent or empty: gnuplot's default. |
Call graph
custom_dashtype
The dash type of gnuplot's custom pattern spec: a dash string (. dot and short gap, - dash and gap, _ long dash and gap, a blank lengthening the last gap) or the lengths (solid, empty, ...) at line width 1; kept for the session (a pattern seen before gets its number back). ok false for a malformed one; 1 (solid) for an empty one.
Returns: integer(kind=I4P)
function custom_dashtype(spec, ok) result(dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
spec | character(len=*) | in | Pattern: a dash string, or the lengths in parentheses. | |
ok | logical | out | Well formed. |
Call graph
style_name
Full name of the gnuplot style word, full or abbreviated as gnuplot 6.0 reads it (its plotstyle_tbl, searched in order, $ marking the shortest abbreviation: l, line, p, lp, i, st, fs, his, e, ye, yerrorl, ...), or foresight's readout, pie, gauge, radar, rose (full words only); empty if unsupported (gnuplot styles foresight lacks included). As gnuplot, his is histeps and histograms need hist.
A chain of tests, not a table: nvfortran 26.9 misreads a 2-D character parameter built by reshape here.
Attributes: pure
Returns: character(len=:)
function style_name(word) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
word | character(len=*) | in | Style word. |
Call graph
gnuplot_abbreviates
Whether word is the keyword pattern as gnuplot's almost_equals reads it: the whole of it, or, if it holds a $, any abbreviation at least as long as the part before the $.
Attributes: pure
Returns: logical
function gnuplot_abbreviates(word, pattern) result(match)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
word | character(len=*) | in | Word. | |
pattern | character(len=*) | in | Keyword, $ before its optional part. |
Call graph
style_with
Plotting style code of a gnuplot with keyword, full or abbreviated (see style_name).
Returns: integer(kind=I4P)
function style_with(name) result(with)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
name | character(len=*) | in | gnuplot style keyword. |
Call graph
dasharray
SVG stroke-dasharray of the dash type, scaled by the line width; empty for solid lines.
Attributes: pure
Returns: character(len=:)
function dasharray(self) result(dashes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph
draws_lines
Whether the style draws lines.
Attributes: elemental
Returns: logical
function draws_lines(self) result(lines)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph
draws_points
Whether the style draws points: every style but lines and readouts (error bars mark their points).
Attributes: elemental
Returns: logical
function draws_points(self) result(points)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph
draws_xbars
Whether the style draws horizontal error bars.
Attributes: elemental
Returns: logical
function draws_xbars(self) result(bars)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph
draws_ybars
Whether the style draws vertical error bars.
Attributes: elemental
Returns: logical
function draws_ybars(self) result(bars)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph
fills
Whether the style is a filled one: boxes, filledcurves, histograms, circles and the panel charts (pie, gauge, radar, rose).
Attributes: elemental
Returns: logical
function fills(self) result(filled)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph
fill_color
Fill color of a filled style: its own (fc) or the line color when solid, none when empty.
Attributes: pure
Returns: character(len=:)
function fill_color(self) result(color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph
stroke_color
Border color of a filled style: its own, the line color, or none without border.
Attributes: pure
Returns: character(len=:)
function stroke_color(self) result(color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph
point_diameter
Point size [px]: the round dot diameter, or the width of a point type shape (gnuplot svg scale).
Attributes: elemental
Returns: real(kind=R8P)
function point_diameter(self) result(diameter)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(style_object) | in | Style. |
Call graph