DataRange implements the plot.DataRanger interface.
()
| 195 | |
| 196 | // DataRange implements the plot.DataRanger interface. |
| 197 | func (e *XErrorBars) DataRange() (xmin, xmax, ymin, ymax float64) { |
| 198 | ymin, ymax = Range(YValues{e}) |
| 199 | xmin = math.Inf(1) |
| 200 | xmax = math.Inf(-1) |
| 201 | for i, err := range e.XErrors { |
| 202 | x := e.XYs[i].X |
| 203 | xlow := x - math.Abs(err.Low) |
| 204 | xhigh := x + math.Abs(err.High) |
| 205 | xmin = math.Min(math.Min(math.Min(xmin, x), xlow), xhigh) |
| 206 | xmax = math.Max(math.Max(math.Max(xmax, x), xlow), xhigh) |
| 207 | } |
| 208 | return |
| 209 | } |
| 210 | |
| 211 | // GlyphBoxes implements the plot.GlyphBoxer interface. |
| 212 | func (e *XErrorBars) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { |