YError returns error bars, implementing [plots.YErrorer] interface.
(row int)
| 232 | |
| 233 | // YError returns error bars, implementing [plots.YErrorer] interface. |
| 234 | func (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 | } |
nothing calls this directly
no test coverage detected