DataRange implements the plot.DataRanger interface.
()
| 87 | |
| 88 | // DataRange implements the plot.DataRanger interface. |
| 89 | func (e *YErrorBars) DataRange() (xmin, xmax, ymin, ymax float64) { |
| 90 | xmin, xmax = Range(XValues{e}) |
| 91 | ymin = math.Inf(1) |
| 92 | ymax = math.Inf(-1) |
| 93 | for i, err := range e.YErrors { |
| 94 | y := e.XYs[i].Y |
| 95 | ylow := y - math.Abs(err.Low) |
| 96 | yhigh := y + math.Abs(err.High) |
| 97 | ymin = math.Min(math.Min(math.Min(ymin, y), ylow), yhigh) |
| 98 | ymax = math.Max(math.Max(math.Max(ymax, y), ylow), yhigh) |
| 99 | } |
| 100 | return |
| 101 | } |
| 102 | |
| 103 | // GlyphBoxes implements the plot.GlyphBoxer interface. |
| 104 | func (e *YErrorBars) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { |