Text-backend axis rendering policy (issue #2069).
Defines the single source of truth for how the text/ASCII backend draws axis spines, tick marks, and how cells are resolved when several plot layers land on the same character cell.
Adopted policy (compared against gnuplot set terminal dumb, plotext,
and UnicodePlots.jl):
| spine spans the data
rows and a continuous bottom - spine spans the data columns. Spines
are never drawn by sampling in data space, so they never degrade into a
dashed data-like line.+) are drawn only at labeled (major) tick positions on
the spine. No minor/unlabeled tick marks and no grid lines are drawn by
default in text output.Author: fortplot contributors
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | LAYER_EMPTY | = | 0 | |
| integer, | public, | parameter | :: | LAYER_GRID | = | 10 | |
| integer, | public, | parameter | :: | LAYER_DATA | = | 20 | |
| integer, | public, | parameter | :: | LAYER_AXIS | = | 30 | |
| integer, | public, | parameter | :: | LAYER_TICK | = | 40 | |
| integer, | public, | parameter | :: | LAYER_LABEL | = | 50 |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | layer | = | LAYER_EMPTY | ||
| character(len=1), | public | :: | glyph | = | ' ' |
Classify a character already present on the canvas into a layer so put_cell can resolve collisions without a parallel layer buffer.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | glyph |
Write glyph into the canvas only when its layer is at least the layer of the glyph already occupying the cell (higher or equal layer wins).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(inout) | :: | canvas(:,:) | |||
| integer, | intent(in) | :: | row | |||
| integer, | intent(in) | :: | col | |||
| character(len=1), | intent(in) | :: | glyph | |||
| integer, | intent(in) | :: | layer |
Map axis tick data values to integer screen cells along one axis.
in_range flags the ticks that fall inside [cell_lo, cell_hi] and
are therefore drawable; callers decide which are labeled.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | tick_values(:) | |||
| integer, | intent(in) | :: | num_ticks | |||
| real(kind=wp), | intent(in) | :: | v_min | |||
| real(kind=wp), | intent(in) | :: | v_max | |||
| integer, | intent(in) | :: | cell_lo | |||
| integer, | intent(in) | :: | cell_hi | |||
| integer, | intent(out) | :: | cells(:) | |||
| logical, | intent(out) | :: | in_range(:) |