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
| Name | Type | Attributes | Description |
|---|---|---|---|
PI_R8 | real(kind=R8P) | parameter | Pi. |
Derived Types
view3d_object
View of a 3D panel.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
rot_x | real(kind=R8P) | Rotation about the x axis [deg] (gnuplot set view ROT_X). | |
rot_z | real(kind=R8P) | Rotation about the z axis [deg] (set view ,ROT_Z). | |
scale | real(kind=R8P) | Scale of the whole plot (set view ,,SCALE). | |
zscale | real(kind=R8P) | Scale of the z axis (set view ,,,SCALE_Z). | |
map | logical | Seen from above, as a map (gnuplot set view map). | |
map_scale | real(kind=R8P) | Scale of the map view (set view map scale S). | |
equal | integer(kind=I4P) | Equal axes: 0 none, 1 x and y (set view equal xy), 2 x, y and z (xyz). | |
azimuth | real(kind=R8P) | Rotation about the line of sight [deg] (set view azimuth A). | |
projection | integer(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_at | logical | The base plane at the height xyplane_z (set xyplane at Z), else relative to the z range (set xyplane relative F, set ticslevel F). | |
ticslevel | real(kind=R8P) | Base plane below the z range, a fraction of it. | |
xyplane_z | real(kind=R8P) | Base plane height. | |
surface | logical | Surfaces drawn (set surface; unset surface leaves the contours only). | |
zzeroaxis | logical | The z zero axis (set zzeroaxis). | |
grid_vertical | logical | Vertical grid lines on the back walls at the x and y ticks (set grid vertical). | |
grid_z | logical | Grid lines at the z ticks on the back walls (set grid ztics). | |
grid_mz | logical | Grid lines at the minor z ticks (set grid mztics). | |
hidden3d | logical | Hidden lines removed (set hidden3d): the surfaces drawn opaque, back to front (a painter's algorithm, not gnuplot's hidden3d.c). | |
hidden_offset | integer(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
| Name | Type | Attributes | Description |
|---|---|---|---|
area | real(kind=R8P) | Plot area: left, right, top, bottom. | |
xtic | real(kind=R8P) | Length of the x ticks at scale 1 (gnuplot's v_tic along the projected y). | |
ytic | real(kind=R8P) | Length of the y ticks at scale 1 (h_tic along the projected x). | |
xdrop | real(kind=R8P) | Anchor of the x tick labels below the axis (v_char along the projected y). | |
ygap | real(kind=R8P) | Anchor of the y tick labels left of the axis (h_char along the projected x). | |
vchar | real(kind=R8P) | gnuplot's character height. | |
hchar | real(kind=R8P) | gnuplot's character width. | |
vtic | real(kind=R8P) | gnuplot's tick length. | |
shift | real(kind=R8P) | Baseline of a text below its anchor (gnuplot's svg vertical centring). | |
title_y | real(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
| Name | Type | Attributes | Description |
|---|---|---|---|
mat | real(kind=R8P) | Transform (row vectors, gnuplot's trans_mat). | |
bounds | real(kind=R8P) | Plot bounds: left, right, bottom, top (gnuplot's page_bounds) [units]. | |
xspan | real(kind=R8P) | Left and right of the projected base plane (plot_bounds after the corners, the title's) [units]. | |
xmiddle | real(kind=R8P) | Middle of the bounds, horizontally [units]. | |
ymiddle | real(kind=R8P) | Middle of the bounds, vertically [units]. | |
xscaler | real(kind=R8P) | Horizontal scale [units]. | |
yscaler | real(kind=R8P) | Vertical scale [units]. | |
xyscaler | real(kind=R8P) | Their geometric mean. | |
height | real(kind=R8P) | Page height [px]. | |
vchar | real(kind=R8P) | gnuplot's character height [units]. | |
hchar | real(kind=R8P) | gnuplot's character width [units]. | |
vtic | real(kind=R8P) | gnuplot's vertical tick length [units]. | |
htic | real(kind=R8P) | gnuplot's horizontal tick length [units]. | |
shift | real(kind=R8P) | Baseline of a text below its anchor (svg vertical centring) [px]. | |
x | real(kind=R8P) | x axis ends (gnuplot's min and max), log10 on a log axis. | |
y | real(kind=R8P) | y axis ends. | |
z | real(kind=R8P) | z axis ends. | |
log | logical | Log axes x, y, z: values mapped by their log10. | |
scale3d | real(kind=R8P) | gnuplot's xscale3d, yscale3d, zscale3d. | |
center3d | real(kind=R8P) | gnuplot's xcenter3d, ycenter3d, zcenter3d. | |
floor_z | real(kind=R8P) | Bottom of the box (log10 on a log axis). | |
ceiling_z | real(kind=R8P) | Top of the box. | |
base_z | real(kind=R8P) | Height of the base plane. | |
zaxis_xy | real(kind=R8P) | Corner of the z axis (gnuplot's zaxis_x, zaxis_y), axis values. | |
back_xy | real(kind=R8P) | Back corner. | |
right_xy | real(kind=R8P) | Right corner. | |
front_xy | real(kind=R8P) | Front corner. | |
xaxis_y | real(kind=R8P) | y where the x axis lies. | |
yaxis_x | real(kind=R8P) | x where the y axis lies. | |
xz_plane | logical | Seen edge-on along y (rot_x 90 or 270, rot_z 0 or 180). | |
yz_plane | logical | Seen edge-on along x (rot_x 90 or 270, rot_z 90 or 270). | |
title | real(kind=R8P) | Title anchor (gnuplot's title_x, title_y) [units]. | |
projection | integer(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)
function map_layout(view, box, page, font_size, title_lines, colorbox, x2label, y2label, x2tics, xmirror_out, margins, screen, ratio, xspan, yspan) result(geo)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
view | type(view3d_object) | in | View. | |
box | real(kind=R8P) | in | Panel box: left, top, width, height [px]. | |
page | real(kind=R8P) | in | Page width and height [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. | |
title_lines | integer(kind=I4P) | in | gnuplot's title lines (0 without a title). | |
colorbox | logical | in | A color box at the right. | |
x2label | logical | in | An x2 label. | |
y2label | logical | in | A y2 label. | |
x2tics | logical | in | x2 tick labels. | |
xmirror_out | real(kind=R8P) | in | Length of the mirrored x ticks above the border, outward [scale]. | |
margins | real(kind=R8P) | in | Left, right, top, bottom margins, negative for the default. | |
screen | logical | in | The margin a page fraction (at screen), else characters. | |
ratio | real(kind=R8P) | in | set size ratio, 0 for none, negative for units. | |
xspan | real(kind=R8P) | in | x range (end minus start). | |
yspan | real(kind=R8P) | in | y 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)
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
view | type(view3d_object) | in | View. | |
box | real(kind=R8P) | in | Panel box: left, top, width, height [px]. | |
page | real(kind=R8P) | in | Page width and height [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. | |
title_lines | integer(kind=I4P) | in | gnuplot's title lines (0 without a title). | |
xr | real(kind=R8P) | in | x axis ends (start, end). | |
yr | real(kind=R8P) | in | y axis ends. | |
zr | real(kind=R8P) | in | z axis ends. | |
logs | logical | in | Log axes x, y, z. | |
base_drawn | logical | in | The base plane drawn: x or y ticks, or a base border. | |
margins | real(kind=R8P) | in | Left, right, top, bottom margins, negative for the default. | |
screen | logical | in | The margin a page fraction (at screen), else characters. | |
key_side | real(kind=R8P) | in | Width of a key outside [units], at the right (negative: left). | |
key_below | real(kind=R8P) | in | Height 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)
function view3d_xyz(f, x, y, z, base, linear) result(v)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
f | type(view3d_frame) | in | The view. | |
x | real(kind=R8P) | in | Abscissa. | |
y | real(kind=R8P) | in | Ordinate. | |
z | real(kind=R8P) | in | Height. | |
base | logical | in | optional | z in the linear space of the axis. |
linear | logical | in | optional | x, 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)
function view3d_page(f, v, truncate, whole) result(p)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
f | type(view3d_frame) | in | The view. | |
v | real(kind=R8P) | in | View coordinates. | |
truncate | logical | in | optional | Truncate the offset to the terminal unit. |
whole | logical | in | optional | Truncate 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)
function lin(values, logarithmic) result(l)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
values | real(kind=R8P) | in | Values. | |
logarithmic | logical | in | A 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)
function view3d_lin(value, logarithmic) result(l)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
value | real(kind=R8P) | in | Value. | |
logarithmic | logical | in | A log axis. |
Call graph