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

Method DataRange

plot/plots/errbars.go:249–261  ·  view source on GitHub ↗

DataRange implements the plot.DataRanger interface.

()

Source from the content-addressed store, hash-verified

247
248// DataRange implements the plot.DataRanger interface.
249func (e *XErrorBars) DataRange() (xmin, xmax, ymin, ymax float32) {
250 ymin, ymax = plot.Range(plot.YValues{e})
251 xmin = math32.Inf(1)
252 xmax = math32.Inf(-1)
253 for i, err := range e.XErrors {
254 x := e.XYs[i].X
255 xlow := x - math32.Abs(err.Low)
256 xhigh := x + math32.Abs(err.High)
257 xmin = math32.Min(math32.Min(math32.Min(xmin, x), xlow), xhigh)
258 xmax = math32.Max(math32.Max(math32.Max(xmax, x), xlow), xhigh)
259 }
260 return
261}

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