func (e *YErrorBars) Plot(c draw.Canvas, p *plot.Plot) {
	trX, trY := p.Transforms(&c)
	for i, err := range e.YErrors {
		x := trX(e.XYs[i].X)
		ylow := trY(e.XYs[i].Y - math.Abs(err.Low))
		yhigh := trY(e.XYs[i].Y + math.Abs(err.High))
		bar := c.ClipLinesY([]vg.Point{{x, ylow}, {x, yhigh}})
		c.StrokeLines(e.LineStyle, bar...)
		e.drawCap(&c, x, ylow)
		e.drawCap(&c, x, yhigh)
	}
}
Plot implements the Plotter interface, drawing labels.
package plotter
import (
	"math"
	"gonum.org/v1/plot"
	"gonum.org/v1/plot/vg"
	"gonum.org/v1/plot/vg/draw"
)
var DefaultCapWidth = vg.Points(5)
type YErrorBars struct {
	XYs
	YErrors
	draw.LineStyle
	CapWidth vg.Length
}
func NewYErrorBars(yerrs interface {
	XYer
	YErrorer
}) (*YErrorBars, error) {
	errors := make(YErrors, yerrs.Len())
	for i := range errors {
		errors[i].Low, errors[i].High = yerrs.YError(i)
		if err := CheckFloats(errors[i].Low, errors[i].High); err != nil {
			return nil, err
		}
	}
	xys, err := CopyXYs(yerrs)
	if err != nil {
		return nil, err
	}
	return &YErrorBars{
		XYs:       xys,
		YErrors:   errors,
		LineStyle: DefaultLineStyle,
		CapWidth:  DefaultCapWidth,
	}, nil
}