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

Method DataRange

plot/plots/errbars.go:140–152  ·  view source on GitHub ↗

DataRange implements the plot.DataRanger interface.

()

Source from the content-addressed store, hash-verified

138
139// DataRange implements the plot.DataRanger interface.
140func (e *YErrorBars) DataRange() (xmin, xmax, ymin, ymax float32) {
141 xmin, xmax = plot.Range(plot.XValues{e})
142 ymin = math32.Inf(1)
143 ymax = math32.Inf(-1)
144 for i, err := range e.YErrors {
145 y := e.XYs[i].Y
146 ylow := y - math32.Abs(err.Low)
147 yhigh := y + math32.Abs(err.High)
148 ymin = math32.Min(math32.Min(math32.Min(ymin, y), ylow), yhigh)
149 ymax = math32.Max(math32.Max(math32.Max(ymax, y), ylow), yhigh)
150 }
151 return
152}
153
154// XErrorBars implements the plot.Plotter, plot.DataRanger,
155// and plot.GlyphBoxer interfaces, drawing horizontal error

Callers

nothing calls this directly

Calls 5

RangeFunction · 0.92
InfFunction · 0.92
AbsFunction · 0.92
MinFunction · 0.92
MaxFunction · 0.92

Tested by

no test coverage detected