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

Function AddXErrorBars

plotutil/add.go:340–355  ·  view source on GitHub ↗

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
})

Source from the content-addressed store, hash-verified

338// If an error occurs then none of the plotters are added
339// to the plot, and the error is returned.
340func 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

Callers

nothing calls this directly

Calls 3

NewXErrorBarsFunction · 0.92
ColorFunction · 0.70
AddMethod · 0.45

Tested by

no test coverage detected