MCPcopy Index your code
hub / github.com/gonum/plot / AddYErrorBars

Function AddYErrorBars

plotutil/add.go:366–381  ·  view source on GitHub ↗

AddYErrorBars adds YErrorBars to a plot. The variadic arguments must be of type plotter.XYer, and plotter.YErrorer. 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.YErrorer
})

Source from the content-addressed store, hash-verified

364// If an error occurs then none of the plotters are added
365// to the plot, and the error is returned.
366func AddYErrorBars(plt *plot.Plot, es ...interface {
367 plotter.XYer
368 plotter.YErrorer
369}) error {
370 var ps []plot.Plotter
371 for i, e := range es {
372 bars, err := plotter.NewYErrorBars(e)
373 if err != nil {
374 return err
375 }
376 bars.Color = Color(i)
377 ps = append(ps, bars)
378 }
379 plt.Add(ps...)
380 return nil
381}

Callers

nothing calls this directly

Calls 3

NewYErrorBarsFunction · 0.92
ColorFunction · 0.70
AddMethod · 0.45

Tested by

no test coverage detected