AddXErrorBars adds XErrorBars to a plot. The variadic arguments must be of type plotter.XYer, and plotter.XErrorer. Each errorer is added to the plot the color from the Colors function corresponding to its position in the argument list. If an error occurs then none of the plotters are added to the
(plt *plot.Plot, es ...interface {
plotter.XYer
plotter.XErrorer
})
| 338 | // If an error occurs then none of the plotters are added |
| 339 | // to the plot, and the error is returned. |
| 340 | func AddXErrorBars(plt *plot.Plot, es ...interface { |
| 341 | plotter.XYer |
| 342 | plotter.XErrorer |
| 343 | }) error { |
| 344 | var ps []plot.Plotter |
| 345 | for i, e := range es { |
| 346 | bars, err := plotter.NewXErrorBars(e) |
| 347 | if err != nil { |
| 348 | return err |
| 349 | } |
| 350 | bars.Color = Color(i) |
| 351 | ps = append(ps, bars) |
| 352 | } |
| 353 | plt.Add(ps...) |
| 354 | return nil |
| 355 | } |
| 356 | |
| 357 | // AddYErrorBars adds YErrorBars to a plot. |
| 358 | // The variadic arguments must be |
nothing calls this directly
no test coverage detected