Skip to content

foresight_view3d ​

foresight_view3d, the view of the 3D panels (gnuplot splot): its settings, the projection and the map layout.

The settings follow gnuplot 6.0's set view, set xyplane (set ticslevel), set surface and set isosamples; their defaults are gnuplot's (set view 60, 30, 1, 1, set xyplane relative 0.5).

Source: src/lib/foresight_view3d.F90

Contents ​

Variables ​

NameTypeAttributesDescription
PI_R8real(kind=R8P)parameterPi.

Derived Types ​

view3d_object ​

View of a 3D panel.

Components

NameTypeAttributesDescription
rot_xreal(kind=R8P)Rotation about the x axis [deg] (gnuplot set view ROT_X).
rot_zreal(kind=R8P)Rotation about the z axis [deg] (set view ,ROT_Z).
scalereal(kind=R8P)Scale of the whole plot (set view ,,SCALE).
zscalereal(kind=R8P)Scale of the z axis (set view ,,,SCALE_Z).
maplogicalSeen from above, as a map (gnuplot set view map).
map_scalereal(kind=R8P)Scale of the map view (set view map scale S).
equalinteger(kind=I4P)Equal axes: 0 none, 1 x and y (set view equal xy), 2 x, y and z (xyz).
azimuthreal(kind=R8P)Rotation about the line of sight [deg] (set view azimuth A).
projectioninteger(kind=I4P)Projection onto a plane: 0 none (or the map), 1 xz, 2 yz (set view projection xz|yz: gnuplot's fixed rotations, the yz one with the z axis reversed).
xyplane_atlogicalThe base plane at the height xyplane_z (set xyplane at Z), else relative to the z range (set xyplane relative F, set ticslevel F).
ticslevelreal(kind=R8P)Base plane below the z range, a fraction of it.
xyplane_zreal(kind=R8P)Base plane height.
surfacelogicalSurfaces drawn (set surface; unset surface leaves the contours only).
zzeroaxislogicalThe z zero axis (set zzeroaxis).
grid_verticallogicalVertical grid lines on the back walls at the x and y ticks (set grid vertical).
grid_zlogicalGrid lines at the z ticks on the back walls (set grid ztics).
grid_mzlogicalGrid lines at the minor z ticks (set grid mztics).
hidden3dlogicalHidden lines removed (set hidden3d): the surfaces drawn opaque, back to front (a painter's algorithm, not gnuplot's hidden3d.c).
hidden_offsetinteger(kind=I4P)Linetype of the underside of a surface after its own (set hidden3d offset N; 0 the same, nooffset).

map_geometry ​

Geometry of a map view, gnuplot 6.0's (graph3d.c, svg terminal metrics): the plot area and the tick, label and title places [px, y down].

Components

NameTypeAttributesDescription
areareal(kind=R8P)Plot area: left, right, top, bottom.
xticreal(kind=R8P)Length of the x ticks at scale 1 (gnuplot's v_tic along the projected y).
yticreal(kind=R8P)Length of the y ticks at scale 1 (h_tic along the projected x).
xdropreal(kind=R8P)Anchor of the x tick labels below the axis (v_char along the projected y).
ygapreal(kind=R8P)Anchor of the y tick labels left of the axis (h_char along the projected x).
vcharreal(kind=R8P)gnuplot's character height.
hcharreal(kind=R8P)gnuplot's character width.
vticreal(kind=R8P)gnuplot's tick length.
shiftreal(kind=R8P)Baseline of a text below its anchor (gnuplot's svg vertical centring).
title_yreal(kind=R8P)Anchor of the title, its first line (before the baseline shift).

view3d_frame ​

A 3D view as gnuplot 6.0's do_3dplot sets it up (graph3d.c boundary3d, util3d.c): the transform of the normalized object space (-1..1 on each axis) to the view, the plot bounds and scales in the svg terminal units (1/100 px, y up), the axis ends, the base plane and the corners of the box where the axes and ticks lie.

Components

NameTypeAttributesDescription
matreal(kind=R8P)Transform (row vectors, gnuplot's trans_mat).
boundsreal(kind=R8P)Plot bounds: left, right, bottom, top (gnuplot's page_bounds) [units].
xspanreal(kind=R8P)Left and right of the projected base plane (plot_bounds after the corners, the title's) [units].
xmiddlereal(kind=R8P)Middle of the bounds, horizontally [units].
ymiddlereal(kind=R8P)Middle of the bounds, vertically [units].
xscalerreal(kind=R8P)Horizontal scale [units].
yscalerreal(kind=R8P)Vertical scale [units].
xyscalerreal(kind=R8P)Their geometric mean.
heightreal(kind=R8P)Page height [px].
vcharreal(kind=R8P)gnuplot's character height [units].
hcharreal(kind=R8P)gnuplot's character width [units].
vticreal(kind=R8P)gnuplot's vertical tick length [units].
hticreal(kind=R8P)gnuplot's horizontal tick length [units].
shiftreal(kind=R8P)Baseline of a text below its anchor (svg vertical centring) [px].
xreal(kind=R8P)x axis ends (gnuplot's min and max), log10 on a log axis.
yreal(kind=R8P)y axis ends.
zreal(kind=R8P)z axis ends.
loglogicalLog axes x, y, z: values mapped by their log10.
scale3dreal(kind=R8P)gnuplot's xscale3d, yscale3d, zscale3d.
center3dreal(kind=R8P)gnuplot's xcenter3d, ycenter3d, zcenter3d.
floor_zreal(kind=R8P)Bottom of the box (log10 on a log axis).
ceiling_zreal(kind=R8P)Top of the box.
base_zreal(kind=R8P)Height of the base plane.
zaxis_xyreal(kind=R8P)Corner of the z axis (gnuplot's zaxis_x, zaxis_y), axis values.
back_xyreal(kind=R8P)Back corner.
right_xyreal(kind=R8P)Right corner.
front_xyreal(kind=R8P)Front corner.
xaxis_yreal(kind=R8P)y where the x axis lies.
yaxis_xreal(kind=R8P)x where the y axis lies.
xz_planelogicalSeen edge-on along y (rot_x 90 or 270, rot_z 0 or 180).
yz_planelogicalSeen edge-on along x (rot_x 90 or 270, rot_z 90 or 270).
titlereal(kind=R8P)Title anchor (gnuplot's title_x, title_y) [units].
projectioninteger(kind=I4P)set view projection: 0 none, 1 xz, 2 yz.

Functions ​

map_layout ​

The map view of a panel in the box (left, top, width, height [px]) of a page (width, height [px]), as gnuplot 6.0's boundary3d and do_3dplot place it, in their integer terminal units (1/100 px of the svg terminal, its font metrics: v_char 1.5, h_char 0.7 font sizes, the ticks half a character height): the plot bounds within the margins (margins in characters or, screen, page fractions; negative for the default ones; left, right, top, bottom), narrowed for the color box (a tenth) and the x2 and y2 labels; their middle; the scales 4/7 of them (unless both margins of a side are on the screen); set size ratio (ratio, -1 equal units over the xspan and yspan ranges) or set view equal xy; the area the projection of the x and y ranges, set view map scale times 1.425 of the scales.

Attributes: pure

Returns: type(map_geometry)

fortran
function map_layout(view, box, page, font_size, title_lines, colorbox, x2label, y2label, x2tics, xmirror_out, margins, screen, ratio, xspan, yspan) result(geo)

Arguments

NameTypeIntentAttributesDescription
viewtype(view3d_object)inView.
boxreal(kind=R8P)inPanel box: left, top, width, height [px].
pagereal(kind=R8P)inPage width and height [px].
font_sizereal(kind=R8P)inFont size [px].
title_linesinteger(kind=I4P)ingnuplot's title lines (0 without a title).
colorboxlogicalinA color box at the right.
x2labellogicalinAn x2 label.
y2labellogicalinA y2 label.
x2ticslogicalinx2 tick labels.
xmirror_outreal(kind=R8P)inLength of the mirrored x ticks above the border, outward [scale].
marginsreal(kind=R8P)inLeft, right, top, bottom margins, negative for the default.
screenlogicalinThe margin a page fraction (at screen), else characters.
ratioreal(kind=R8P)inset size ratio, 0 for none, negative for units.
xspanreal(kind=R8P)inx range (end minus start).
yspanreal(kind=R8P)iny range.

Call graph

view3d_setup ​

The 3D view of a panel in the box (left, top, width, height [px]) of a page (width, height [px]), as gnuplot 6.0's do_3dplot and boundary3d set it up in the svg terminal units (font metrics as map_layout's): the plot bounds within the default margins (characters or at screen ones on the left, screen ones elsewhere), a key outside at the right or left (key_side, its width [units], negative at the left) or below (key_below, its height), squared by set view equal; the scales 4/7 of them; the transform rot_z, rot_x, half the view scale, then the azimuth; the base plane (set xyplane) and the box (base_drawn: x or y ticks or a base border draw it, so the box reaches it); the axis scales, set view equal xy|xyz; the corners of the axes by the quadrant of rot_z (and rot_x).

Attributes: pure

Returns: type(view3d_frame)

fortran
function view3d_setup(view, box, page, font_size, title_lines, xr, yr, zr, logs, base_drawn, margins, screen, key_side, key_below) result(f)

Arguments

NameTypeIntentAttributesDescription
viewtype(view3d_object)inView.
boxreal(kind=R8P)inPanel box: left, top, width, height [px].
pagereal(kind=R8P)inPage width and height [px].
font_sizereal(kind=R8P)inFont size [px].
title_linesinteger(kind=I4P)ingnuplot's title lines (0 without a title).
xrreal(kind=R8P)inx axis ends (start, end).
yrreal(kind=R8P)iny axis ends.
zrreal(kind=R8P)inz axis ends.
logslogicalinLog axes x, y, z.
base_drawnlogicalinThe base plane drawn: x or y ticks, or a base border.
marginsreal(kind=R8P)inLeft, right, top, bottom margins, negative for the default.
screenlogicalinThe margin a page fraction (at screen), else characters.
key_sidereal(kind=R8P)inWidth of a key outside [units], at the right (negative: left).
key_belowreal(kind=R8P)inHeight of a key below the plot [units] (gnuplot's bottom margin key).

Call graph

view3d_xyz ​

gnuplot's map3d_xyz: the point (x, y, z) (axis values; base: z already in the linear space of the z axis, as the base, floor and ceiling heights; linear: all three in the linear spaces of their axes) normalized to -1..1 over the box and transformed into the view.

Attributes: pure

Returns: real(kind=R8P)

fortran
function view3d_xyz(f, x, y, z, base, linear) result(v)

Arguments

NameTypeIntentAttributesDescription
ftype(view3d_frame)inThe view.
xreal(kind=R8P)inAbscissa.
yreal(kind=R8P)inOrdinate.
zreal(kind=R8P)inHeight.
baselogicalinoptionalz in the linear space of the axis.
linearlogicalinoptionalx, y and z in the linear spaces of their axes.

Call graph

view3d_page ​

The page position [px, y down] of the view point v (gnuplot's TERMCOORD_DOUBLE; truncate: TERMCOORD, the offset from the middle truncated toward zero to the terminal unit, as points and texts; whole: the terminal position truncated, as the lines of draw_clip_line).

Attributes: pure

Returns: real(kind=R8P)

fortran
function view3d_page(f, v, truncate, whole) result(p)

Arguments

NameTypeIntentAttributesDescription
ftype(view3d_frame)inThe view.
vreal(kind=R8P)inView coordinates.
truncatelogicalinoptionalTruncate the offset to the terminal unit.
wholelogicalinoptionalTruncate the position to the terminal unit.

Call graph

lin ​

The values in the linear space of their axis: log10 on a log axis.

Attributes: pure

Returns: real(kind=R8P)

fortran
function lin(values, logarithmic) result(l)

Arguments

NameTypeIntentAttributesDescription
valuesreal(kind=R8P)inValues.
logarithmiclogicalinA log axis.

Call graph

view3d_lin ​

A value in the linear space of its axis: log10 on a log axis.

Attributes: elemental

Returns: real(kind=R8P)

fortran
function view3d_lin(value, logarithmic) result(l)

Arguments

NameTypeIntentAttributesDescription
valuereal(kind=R8P)inValue.
logarithmiclogicalinA log axis.

Call graph

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