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

Method Norm

plot/axis.go:164–166  ·  view source on GitHub ↗

Norm returns the value of x, given in the data coordinate system, normalized to its distance as a fraction of the range of this axis. For example, if x is a.Min then the return value is 0, and if x is a.Max then the return value is 1.

(x float32)

Source from the content-addressed store, hash-verified

162// range of this axis. For example, if x is a.Min then the return
163// value is 0, and if x is a.Max then the return value is 1.
164func (ax *Axis) Norm(x float32) float32 {
165 return ax.Scale.Normalize(ax.Min, ax.Max, x)
166}

Callers 5

tickPosXMethod · 0.95
drawXMethod · 0.95
drawYMethod · 0.95
PXMethod · 0.80
PYMethod · 0.80

Calls 1

NormalizeMethod · 0.65

Tested by

no test coverage detected