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

Method YError

plot/plotcore/tablexy.go:234–253  ·  view source on GitHub ↗

YError returns error bars, implementing [plots.YErrorer] interface.

(row int)

Source from the content-addressed store, hash-verified

232
233// YError returns error bars, implementing [plots.YErrorer] interface.
234func (txy *tableXY) YError(row int) (float32, float32) {
235 if txy.table == nil || txy.table.Table == nil || row >= txy.table.Len() {
236 return 0, 0
237 }
238 trow := txy.table.Indexes[row] // true table row
239 ec := txy.table.Table.Columns[txy.errColumn]
240 eval := float32(0.0)
241 switch {
242 case ec.IsString():
243 eval = float32(row)
244 case ec.NumDims() > 1:
245 _, sz := ec.RowCellSize()
246 if txy.yIndex < sz && txy.yIndex >= 0 {
247 eval = float32(ec.FloatRowCell(trow, txy.yIndex))
248 }
249 default:
250 eval = float32(ec.Float1D(trow))
251 }
252 return -eval, eval
253}

Callers

nothing calls this directly

Calls 6

LenMethod · 0.65
IsStringMethod · 0.65
NumDimsMethod · 0.65
RowCellSizeMethod · 0.65
FloatRowCellMethod · 0.65
Float1DMethod · 0.65

Tested by

no test coverage detected