MCPcopy Create free account
hub / github.com/cogentcore/core / Defaults

Method Defaults

plot/axis.go:76–95  ·  view source on GitHub ↗

Sets Defaults, range is (∞, ­∞), and thus any finite value is less than Min and greater than Max.

(dim math32.Dims)

Source from the content-addressed store, hash-verified

74// Sets Defaults, range is (∞, ­∞), and thus any finite
75// value is less than Min and greater than Max.
76func (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.
98func (ax *Axis) SanitizeRange() {

Callers

nothing calls this directly

Calls 4

InfFunction · 0.92
DefaultsMethod · 0.65
DpMethod · 0.45
PtMethod · 0.45

Tested by

no test coverage detected