Skip to content

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 ​

Variables ​

NameTypeAttributesDescription
CUSTOM_DASH_BASEinteger(kind=I4P)parameterDash types above it are custom patterns (custom_dashtype).
MAX_CUSTOM_DASHESinteger(kind=I4P)parameterCustom dash patterns kept.
custom_dashescharacter(len=160)savePatterns.
custom_dash_countinteger(kind=I4P)savePatterns kept.
WITH_LINESinteger(kind=I4P)parametergnuplot with lines.
WITH_POINTSinteger(kind=I4P)parametergnuplot with points.
WITH_LINESPOINTSinteger(kind=I4P)parametergnuplot with linespoints.
WITH_YERRORBARSinteger(kind=I4P)parametergnuplot with yerrorbars.
WITH_XERRORBARSinteger(kind=I4P)parametergnuplot with xerrorbars.
WITH_XYERRORBARSinteger(kind=I4P)parametergnuplot with xyerrorbars.
WITH_READOUTinteger(kind=I4P)parameterforesight with readout: the last value in seven-segment digits.
WITH_BOXESinteger(kind=I4P)parametergnuplot with boxes.
WITH_FILLEDCURVESinteger(kind=I4P)parametergnuplot with filledcurves.
WITH_HISTOGRAMSinteger(kind=I4P)parametergnuplot with histograms.
WITH_IMAGEinteger(kind=I4P)parametergnuplot with image.
WITH_CIRCLESinteger(kind=I4P)parametergnuplot with circles: circles and wedges.
WITH_PIEinteger(kind=I4P)parameterforesight with pie: a pie or donut chart.
WITH_GAUGEinteger(kind=I4P)parameterforesight with gauge: the last value on a sweep gauge.
WITH_RADARinteger(kind=I4P)parameterforesight with radar: a polygon over the spokes of the rows.
WITH_ROSEinteger(kind=I4P)parameterforesight with rose: equal sectors, area or radius by value.
WITH_IMPULSESinteger(kind=I4P)parametergnuplot with impulses: a segment from y = 0 to each point.
WITH_STEPSinteger(kind=I4P)parametergnuplot with steps: horizontal, then vertical.
WITH_FSTEPSinteger(kind=I4P)parametergnuplot with fsteps: vertical, then horizontal.
WITH_HISTEPSinteger(kind=I4P)parametergnuplot with histeps: steps around the points, from y = 0.
WITH_DOTSinteger(kind=I4P)parametergnuplot with dots: a tiny dot per point.
WITH_YERRORLINESinteger(kind=I4P)parametergnuplot with yerrorlines: linespoints and y error bars.
WITH_XERRORLINESinteger(kind=I4P)parametergnuplot with xerrorlines: linespoints and x error bars.
WITH_XYERRORLINESinteger(kind=I4P)parametergnuplot with xyerrorlines: linespoints and both bars.
WITH_BOXERRORBARSinteger(kind=I4P)parametergnuplot with boxerrorbars: boxes with y error bars.
WITH_BOXXYERRORinteger(kind=I4P)parametergnuplot with boxxyerror: a rectangle per point.
WITH_CANDLESTICKSinteger(kind=I4P)parametergnuplot with candlesticks: box and whiskers.
WITH_FINANCEBARSinteger(kind=I4P)parametergnuplot with financebars: high-low bars, open/close ticks.
WITH_BOXPLOTinteger(kind=I4P)parametergnuplot with boxplot: quartiles of the values, outliers.
WITH_VECTORSinteger(kind=I4P)parametergnuplot with vectors: arrows from x:y by dx:dy.
WITH_ARROWSinteger(kind=I4P)parametergnuplot with arrows: arrows from x:y by length and angle.
WITH_ELLIPSESinteger(kind=I4P)parametergnuplot with ellipses: an ellipse per point.
WITH_POLYGONSinteger(kind=I4P)parametergnuplot with polygons: a closed polygon per block.
WITH_LABELSinteger(kind=I4P)parametergnuplot with labels: text at each point.
WITH_SECTORSinteger(kind=I4P)parametergnuplot with sectors: annular sectors.
WITH_PARALLELAXESinteger(kind=I4P)parametergnuplot with parallelaxes: an axis per item, a line per row.
WITH_SPIDERPLOTinteger(kind=I4P)parametergnuplot with spiderplot: a radial axis per item, a polygon per row.
WITH_FILLSTEPSinteger(kind=I4P)parametergnuplot with fillsteps: the area under steps filled.
WITH_PM3Dinteger(kind=I4P)parametergnuplot with pm3d (splot): a surface as colored quadrangles.
WITH_MASKinteger(kind=I4P)parametergnuplot with mask: polygons masking the mask items, not drawn.
STYLE_NAMEScharacter(len=*)parameterSupported style names.
FILL_EMPTYinteger(kind=I4P)parametergnuplot set style fill empty: no fill.
FILL_SOLIDinteger(kind=I4P)parametergnuplot set style fill solid.
FILL_PATTERNinteger(kind=I4P)parametergnuplot set style fill pattern N.
PATTERNSinteger(kind=I4P)parameterFill 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).
PALETTEcharacter(len=7)parametergnuplot 5 line colors.
DIAMETER_AT_UNIT_SIZEreal(kind=R8P)parameterRound dot diameter at pointsize 1 [px].
MARKER_AT_UNIT_SIZEreal(kind=R8P)parameterPoint type size at pointsize 1 [px], gnuplot svg.

Derived Types ​

style_object ​

Series drawing style.

Components

NameTypeAttributesDescription
withinteger(kind=I4P)Plotting style.
colorcharacter(len=:)allocatableLine and point color (SVG color).
linewidthreal(kind=R8P)Line width [px].
dashtypeinteger(kind=I4P)gnuplot dash type: 1 solid, 2..5 dash patterns.
pointsizereal(kind=R8P)Point size scale factor.
pointtypeinteger(kind=I4P)gnuplot point type: 0 a dot, 1.. the shapes (cycling every 15); negative for foresight's round dot.
fillinteger(kind=I4P)Fill of filled styles.
densityreal(kind=R8P)Fill opacity, solid fills.
borderlogicalBorder of filled styles.
border_colorcharacter(len=:)allocatableBorder color, empty for the line color.
segmentsinteger(kind=I4P)Cells over the y range of a segmented fill, 0 for none.
patterninteger(kind=I4P)Fill pattern (FILL_PATTERN), cycling every PATTERNS.
fill_rgbcharacter(len=:)allocatableFill color (gnuplot fc), empty or unallocated for the line color.
point_charcharacter(len=:)allocatableA character as the point (gnuplot pt "c"), drawn in place of the point type when allocated and not empty.

Type-Bound Procedures

NameAttributesDescription
dasharraypass(self)SVG dash array.
draws_xbarspass(self)Whether horizontal error bars are drawn.
fillspass(self)Whether the style is a filled one.
fill_colorpass(self)Fill color, none if empty.
stroke_colorpass(self)Border color of a filled style, none if no border.
draws_ybarspass(self)Whether vertical error bars are drawn.
draws_linespass(self)Whether lines are drawn.
draws_pointspass(self)Whether points are drawn.
point_diameterpass(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

fortran
subroutine sequence_colors(name, n, colors, bad)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inSequence name.
ninteger(kind=I4P)inColors of a categorical order; < 1 for 8.
colorscharacter(len=9)outallocatableColors, #rrggbb; empty for gnuplot's default.
badcharacter(len=:)outallocatableWhy 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

fortran
subroutine pattern_parts(fill, pattern, color)

Arguments

NameTypeIntentAttributesDescription
fillcharacter(len=*)inFill color.
patterninteger(kind=I4P)outPattern, 0 for none.
colorcharacter(len=:)outallocatableColor.

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.

fortran
subroutine fill_style(words, style, bad)

Arguments

NameTypeIntentAttributesDescription
wordscharacter(len=*)inFill style words.
styletype(style_object)inoutStyle updated.
badcharacter(len=:)outallocatableFirst 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=:)

fortran
function default_color(index, colors) result(color)

Arguments

NameTypeIntentAttributesDescription
indexinteger(kind=I4P)inSeries index, from 1.
colorscharacter(len=9)inoptionalActive 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)

fortran
function custom_dashtype(spec, ok) result(dt)

Arguments

NameTypeIntentAttributesDescription
speccharacter(len=*)inPattern: a dash string, or the lengths in parentheses.
oklogicaloutWell 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=:)

fortran
function style_name(word) result(name)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inStyle 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

fortran
function gnuplot_abbreviates(word, pattern) result(match)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inWord.
patterncharacter(len=*)inKeyword, $ 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)

fortran
function style_with(name) result(with)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)ingnuplot 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=:)

fortran
function dasharray(self) result(dashes)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

Call graph

draws_lines ​

Whether the style draws lines.

Attributes: elemental

Returns: logical

fortran
function draws_lines(self) result(lines)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

Call graph

draws_points ​

Whether the style draws points: every style but lines and readouts (error bars mark their points).

Attributes: elemental

Returns: logical

fortran
function draws_points(self) result(points)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

Call graph

draws_xbars ​

Whether the style draws horizontal error bars.

Attributes: elemental

Returns: logical

fortran
function draws_xbars(self) result(bars)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

Call graph

draws_ybars ​

Whether the style draws vertical error bars.

Attributes: elemental

Returns: logical

fortran
function draws_ybars(self) result(bars)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

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

fortran
function fills(self) result(filled)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

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=:)

fortran
function fill_color(self) result(color)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

Call graph

stroke_color ​

Border color of a filled style: its own, the line color, or none without border.

Attributes: pure

Returns: character(len=:)

fortran
function stroke_color(self) result(color)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

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)

fortran
function point_diameter(self) result(diameter)

Arguments

NameTypeIntentAttributesDescription
selfclass(style_object)inStyle.

Call graph

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