Sets Defaults, range is (∞, ∞), and thus any finite value is less than Min and greater than Max.
(dim math32.Dims)
| 74 | // Sets Defaults, range is (∞, ∞), and thus any finite |
| 75 | // value is less than Min and greater than Max. |
| 76 | func (ax *Axis) Defaults(dim math32.Dims) { |
| 77 | ax.Min = math32.Inf(+1) |
| 78 | ax.Max = math32.Inf(-1) |
| 79 | ax.Axis = dim |
| 80 | ax.Line.Defaults() |
| 81 | ax.Label.Defaults() |
| 82 | ax.Label.Style.Size.Dp(20) |
| 83 | ax.Padding.Pt(5) |
| 84 | ax.TickText.Defaults() |
| 85 | ax.TickText.Style.Size.Dp(16) |
| 86 | ax.TickText.Style.Padding.Dp(2) |
| 87 | ax.TickLine.Defaults() |
| 88 | ax.TickLength.Pt(8) |
| 89 | if dim == math32.Y { |
| 90 | ax.Label.Style.Rotation = -90 |
| 91 | ax.TickText.Style.Align = styles.End |
| 92 | } |
| 93 | ax.Scale = LinearScale{} |
| 94 | ax.Ticker = DefaultTicks{} |
| 95 | } |
| 96 | |
| 97 | // SanitizeRange ensures that the range of the axis makes sense. |
| 98 | func (ax *Axis) SanitizeRange() { |