1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! The scale specification: what an axis means, as a value.
/// The scale of one axis.
///
/// Set with [`crate::Plot::x_scale`] / [`crate::Plot::y_scale`]; the sugar methods
/// (`log_y()`, `time_x()`) are shorthands for the common cases. [`Auto`](Scale::Auto)
/// is the default and adapts to the layers; an explicit scale is always honored.
///
/// # Mark compatibility
///
/// `Auto` resolves the x axis to bands for [`Bars::new`](crate::Bars::new) and
/// [`Range::over`](crate::Range::over), and to linear otherwise. The explicit x-axis
/// contract is:
///
/// | Mark | Linear / Time | Log | Bands |
/// | --- | --- | --- | --- |
/// | Line, Points, Area, numeric Range, Rule, Text | yes | yes; non-positive values are gaps | yes; positions are band indices |
/// | `Bars::new`, `Range::over` | no | no | yes |
/// | `Bars::spans` | yes | yes | no |
/// | Cells | yes | yes, with positive extents | yes; grid indices map to bands, no extents |
///
/// On y, Bands positions continuous marks against band indices exactly like x,
/// and maps Cells rows onto the bands top-down — row 0 is the top band, so a
/// labeled matrix reads in matrix order. Bars are rejected on a Bands y axis
/// (their length is numeric). Linear and Time accept every mark. Log accepts Line,
/// Points, Range, Rule, Text, banded Area, and Cells with positive extents; it rejects
/// Bars and zero-baseline Area because zero has no logarithmic position.