plotter

package
v0.0.0-...-7c6133f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

The plotter package defines a variety of standard Plotters for the Plotinum plot package.

Plotters use the primitives provided by the plot package to draw to the data area of a plot. This package provides some standard data styles such as lines, scatter plots, box plots, labels, and more.

New* functions return an error if the data contains Inf, NaN, or is empty. Some of the New* functions return other plotter-specific errors too.

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultFont is the default font name.
	DefaultFont = "Times-Roman"

	// DefaultFontSize is the default font.
	DefaultFontSize = vg.Points(10)
)
View Source
var (
	// DefaultLineStyle is the default style for drawing
	// lines.
	DefaultLineStyle = plot.LineStyle{
		Color:    color.Black,
		Width:    vg.Points(1),
		Dashes:   []vg.Length{},
		DashOffs: 0,
	}

	// DefaultGlyphStyle is the default style used
	// for gyph marks.
	DefaultGlyphStyle = plot.GlyphStyle{
		Color:  color.Black,
		Radius: vg.Points(2.5),
		Shape:  plot.RingGlyph{},
	}
)
View Source
var (
	ErrInfinity = errors.New("Infinite data point")
	ErrNaN      = errors.New("NaN data point")
	ErrNoData   = errors.New("No data points")
)
View Source
var (
	// DefaultQuartMedianStyle is a fat dot.
	DefaultQuartMedianStyle = plot.GlyphStyle{
		Color:  color.Black,
		Radius: vg.Points(1.5),
		Shape:  plot.CircleGlyph{},
	}

	// DefaultQuartWhiskerStyle is a hairline.
	DefaultQuartWhiskerStyle = plot.LineStyle{
		Color:    color.Black,
		Width:    vg.Points(0.5),
		Dashes:   []vg.Length{},
		DashOffs: 0,
	}
)
View Source
var DefaultCapWidth = vg.Points(5)

DefaultCapWidth is the default width of error bar caps.

View Source
var (
	// DefaultGridLineStyle is the default style for grid lines.
	DefaultGridLineStyle = plot.LineStyle{
		Color: color.Gray{128},
		Width: vg.Points(0.25),
	}
)

Functions

func CheckFloats

func CheckFloats(fs ...float64) error

CheckFloats returns an error if any of the arguments are NaN or Infinity.

func NewLinePoints

func NewLinePoints(xys XYer) (*Line, *Scatter, error)

NewLinePoints returns both a Line and a Points for the given point data.

func Range

func Range(vs Valuer) (min, max float64)

Range returns the minimum and maximum values.

func XYRange

func XYRange(xys XYer) (xmin, xmax, ymin, ymax float64)

XYRange returns the minimum and maximum x and y values.

Types

type BarChart

type BarChart struct {
	Values

	// Width is the width of the bars.
	Width vg.Length

	// Color is the fill color of the bars.
	Color color.Color

	// LineStyle is the style of the outline of the bars.
	plot.LineStyle

	// Offset is added to the x location of each bar.
	// When the Offset is zero, the bars are drawn
	// centered at their x location.
	Offset vg.Length

	// XMin is the X location of the first bar.  XMin
	// can be changed to move groups of bars
	// down the X axis in order to make grouped
	// bar charts.
	XMin float64
	// contains filtered or unexported fields
}

func NewBarChart

func NewBarChart(vs Valuer, width vg.Length) (*BarChart, error)

NewBarChart returns a new bar chart with a single bar for each value. The bars heights correspond to the values and their x locations correspond to the index of their value in the Valuer.

func (*BarChart) BarHeight

func (b *BarChart) BarHeight(i int) float64

BarHeight returns the maximum y value of the ith bar, taking into account any bars upon which it is stacked.

func (*BarChart) DataRange

func (b *BarChart) DataRange() (xmin, xmax, ymin, ymax float64)

DataRange implements the plot.DataRanger interface.

func (*BarChart) GlyphBoxes

func (b *BarChart) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes implements the GlyphBoxer interface.

func (*BarChart) Plot

func (b *BarChart) Plot(da plot.DrawArea, plt *plot.Plot)

Plot implements the plot.Plotter interface.

func (*BarChart) StackOn

func (b *BarChart) StackOn(on *BarChart)

StackOn stacks a bar chart on top of another, and sets the XMin and Offset to that of the chart upon which it is being stacked.

func (*BarChart) Thumbnail

func (b *BarChart) Thumbnail(da *plot.DrawArea)

type BoxPlot

type BoxPlot struct {

	// Offset is added to the x location of each box.
	// When the Offset is zero, the boxes are drawn
	// centered at their x location.
	Offset vg.Length

	// Width is the width used to draw the box.
	Width vg.Length

	// CapWidth is the width of the cap used to top
	// off a whisker.
	CapWidth vg.Length

	// GlyphStyle is the style of the outside point glyphs.
	GlyphStyle plot.GlyphStyle

	// BoxStyle is the line style for the box.
	BoxStyle plot.LineStyle

	// MedianStyle is the line style for the median line.
	MedianStyle plot.LineStyle

	// WhiskerStyle is the line style used to draw the
	// whiskers.
	WhiskerStyle plot.LineStyle
	// contains filtered or unexported fields
}

BoxPlot implements the Plotter interface, drawing a boxplot to represent the distribution of values.

func NewBoxPlot

func NewBoxPlot(w vg.Length, loc float64, values Valuer) (*BoxPlot, error)

NewBoxPlot returns a new BoxPlot that represents the distribution of the given values. The style of the box plot is that used for Tukey's schematic plots is “Exploratory Data Analysis.”

An error is returned if the boxplot is created with no values.

The fence values are 1.5x the interquartile before the first quartile and after the third quartile. Any value that is outside of the fences are drawn as Outside points. The adjacent values (to which the whiskers stretch) are the minimum and maximum values that are not outside the fences.

func (*BoxPlot) DataRange

func (b *BoxPlot) DataRange() (float64, float64, float64, float64)

DataRange returns the minimum and maximum x and y values, implementing the plot.DataRanger interface.

func (*BoxPlot) GlyphBoxes

func (b *BoxPlot) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes returns a slice of GlyphBoxes for the points and for the median line of the boxplot, implementing the plot.GlyphBoxer interface

func (*BoxPlot) OutsideLabels

func (b *BoxPlot) OutsideLabels(labels Labeller) (*Labels, error)

OutsideLabels returns a *Labels that will plot a label for each of the outside points. The labels are assumed to correspond to the points used to create the box plot.

func (*BoxPlot) Plot

func (b *BoxPlot) Plot(da plot.DrawArea, plt *plot.Plot)

type Bubbles

type Bubbles struct {
	XYZs

	// Color is the color of the bubbles.
	color.Color

	// MinRadius and MaxRadius give the minimum
	// and maximum bubble radius respectively.
	// The radii of each bubble is interpolated linearly
	// between these two values.
	MinRadius, MaxRadius vg.Length

	// MinZ and MaxZ are the minimum and
	// maximum Z values from the data.
	MinZ, MaxZ float64
}

Bubbles implements the Plotter interface, drawing a bubble plot of x, y, z triples where the z value determines the radius of the bubble.

func NewBubbles

func NewBubbles(xyz XYZer, min, max vg.Length) (*Bubbles, error)

NewBubbles creates as new bubble plot plotter for the given data, with a minimum and maximum bubble radius.

func (*Bubbles) DataRange

func (bs *Bubbles) DataRange() (xmin, xmax, ymin, ymax float64)

DataRange implements the DataRange method of the plot.DataRanger interface.

func (*Bubbles) GlyphBoxes

func (bs *Bubbles) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes implements the GlyphBoxes method of the plot.GlyphBoxer interface.

func (*Bubbles) Plot

func (bs *Bubbles) Plot(da plot.DrawArea, plt *plot.Plot)

Plot implements the Plot method of the plot.Plotter interface.

type Errors

type Errors []struct{ Low, High float64 }

Errors is a slice of low and high error values.

type Function

type Function struct {
	F       func(float64) float64
	Samples int
	plot.LineStyle
}

Function implements the Plotter interface, drawing a line for the given function.

func NewFunction

func NewFunction(f func(float64) float64) *Function

NewFunction returns a Function that plots F using the default line style with 50 samples.

func (*Function) Plot

func (f *Function) Plot(da plot.DrawArea, p *plot.Plot)

Plot implements the Plotter interface, drawing a line that connects each point in the Line.

func (Function) Thumbnail

func (f Function) Thumbnail(da *plot.DrawArea)

Thumbnail draws a line in the given style down the center of a DrawArea as a thumbnail representation of the LineStyle of the function.

type GlyphBoxes

type GlyphBoxes struct {
	plot.LineStyle
}

GlyphBoxes implements the Plotter interface, drawing all of the glyph boxes of the plot. This is intended for debugging.

func NewGlyphBoxes

func NewGlyphBoxes() *GlyphBoxes

func (GlyphBoxes) Plot

func (g GlyphBoxes) Plot(da plot.DrawArea, plt *plot.Plot)

type Grid

type Grid struct {
	// Vertical is the style of the vertical lines.
	Vertical plot.LineStyle

	// Horizontal is the style of the horizontal lines.
	Horizontal plot.LineStyle
}

Grid implements the plot.Plotter interface, drawing a set of grid lines at the major tick marks.

func NewGrid

func NewGrid() *Grid

NewGrid returns a new grid with both vertical and horizontal lines using the default grid line style.

func (*Grid) Plot

func (g *Grid) Plot(da plot.DrawArea, plt *plot.Plot)

Plot implements the plot.Plotter interface.

type Histogram

type Histogram struct {
	// Bins is the set of bins for this histogram.
	Bins []HistogramBin

	// Width is the width of each bin.
	Width float64

	// FillColor is the color used to fill each
	// bar of the histogram.  If the color is nil
	// then the bars are not filled.
	FillColor color.Color

	// LineStyle is the style of the outline of each
	// bar of the histogram.
	plot.LineStyle
}

Histogram implements the Plotter interface, drawing a histogram of the data.

func NewHist

func NewHist(vs Valuer, n int) (*Histogram, error)

NewHist returns a new histogram, as in NewHistogram, except that it accepts a Valuer instead of an XYer.

func NewHistogram

func NewHistogram(xy XYer, n int) (*Histogram, error)

NewHistogram returns a new histogram that represents the distribution of values using the given number of bins.

Each y value is assumed to be the frequency count for the corresponding x.

If the number of bins is non-positive than a reasonable default is used.

func (*Histogram) DataRange

func (h *Histogram) DataRange() (xmin, xmax, ymin, ymax float64)

DataRange returns the minimum and maximum X and Y values

func (*Histogram) Normalize

func (h *Histogram) Normalize(sum float64)

Normalize normalizes the histogram so that the total area beneath it sums to a given value.

func (*Histogram) Plot

func (h *Histogram) Plot(da plot.DrawArea, p *plot.Plot)

Plot implements the Plotter interface, drawing a line that connects each point in the Line.

type HistogramBin

type HistogramBin struct {
	Min, Max float64
	Weight   float64
}

A HistogramBin approximates the number of values within a range by a single number (the weight).

type HorizBoxPlot

type HorizBoxPlot struct{ *BoxPlot }

HorizBoxPlot is like a regular BoxPlot, however, it draws horizontally instead of Vertically.

func MakeHorizBoxPlot

func MakeHorizBoxPlot(w vg.Length, loc float64, vs Valuer) (HorizBoxPlot, error)

MakeHorizBoxPlot returns a HorizBoxPlot, plotting the values in a horizontal box plot centered along a fixed location of the y axis.

func (HorizBoxPlot) DataRange

func (b HorizBoxPlot) DataRange() (float64, float64, float64, float64)

DataRange returns the minimum and maximum x and y values, implementing the plot.DataRanger interface.

func (HorizBoxPlot) GlyphBoxes

func (b HorizBoxPlot) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes returns a slice of GlyphBoxes for the points and for the median line of the boxplot, implementing the plot.GlyphBoxer interface

func (*HorizBoxPlot) OutsideLabels

func (b *HorizBoxPlot) OutsideLabels(labels Labeller) (*Labels, error)

OutsideLabels returns a *Labels that will plot a label for each of the outside points. The labels are assumed to correspond to the points used to create the box plot.

func (HorizBoxPlot) Plot

func (b HorizBoxPlot) Plot(da plot.DrawArea, plt *plot.Plot)

type HorizQuartPlot

type HorizQuartPlot struct{ *QuartPlot }

HorizQuartPlot is like a regular QuartPlot, however, it draws horizontally instead of Vertically.

func MakeHorizQuartPlot

func MakeHorizQuartPlot(loc float64, vs Valuer) (HorizQuartPlot, error)

MakeHorizQuartPlot returns a HorizQuartPlot, plotting the values in a horizontal plot centered along a fixed location of the y axis.

func (HorizQuartPlot) DataRange

func (b HorizQuartPlot) DataRange() (float64, float64, float64, float64)

DataRange returns the minimum and maximum x and y values, implementing the plot.DataRanger interface.

func (HorizQuartPlot) GlyphBoxes

func (b HorizQuartPlot) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes returns a slice of GlyphBoxes for the plot, implementing the plot.GlyphBoxer interface.

func (*HorizQuartPlot) OutsideLabels

func (b *HorizQuartPlot) OutsideLabels(labels Labeller) (*Labels, error)

OutsideLabels returns a *Labels that will plot a label for each of the outside points. The labels are assumed to correspond to the points used to create the plot.

func (HorizQuartPlot) Plot

func (b HorizQuartPlot) Plot(da plot.DrawArea, plt *plot.Plot)

type Labeller

type Labeller interface {
	// Label returns a label.
	Label(int) string
}

Labeller wraps the Label methods.

type Labels

type Labels struct {
	XYs

	// Labels is the set of labels corresponding
	// to each point.
	Labels []string

	// TextStyle is the style of the label text.
	plot.TextStyle

	// XAlign and YAlign are multiplied by the width
	// and height of each label respectively and the
	// added to the final location.  E.g., XAlign=-0.5
	// and YAlign=-0.5 centers the label at the given
	// X, Y location, and XAlign=0, YAlign=0 aligns
	// the text to the left of the point, and XAlign=-1,
	// YAlign=0 aligns the text to the right of the point.
	XAlign, YAlign float64

	// XOffset and YOffset are added directly to the final
	// label X and Y location respectively.
	XOffset, YOffset vg.Length
}

Labels implements the Plotter interface, drawing a set of labels at specified points.

func NewLabels

func NewLabels(d interface {
	XYer
	Labeller
}) (*Labels, error)

NewLabels returns a new Labels using the DefaultFont and the DefaultFontSize.

func (*Labels) DataRange

func (l *Labels) DataRange() (xmin, xmax, ymin, ymax float64)

DataRange returns the minimum and maximum X and Y values

func (*Labels) GlyphBoxes

func (l *Labels) GlyphBoxes(p *plot.Plot) []plot.GlyphBox

GlyphBoxes returns a slice of GlyphBoxes, one for each of the labels, implementing the plot.GlyphBoxer interface.

func (*Labels) Plot

func (l *Labels) Plot(da plot.DrawArea, p *plot.Plot)

Plot implements the Plotter interface, drawing labels.

type Line

type Line struct {
	// XYs is a copy of the points for this line.
	XYs

	// LineStyle is the style of the line connecting
	// the points.
	plot.LineStyle

	// ShadeColor is the color of the shaded area.
	ShadeColor *color.Color
}

Line implements the Plotter interface, drawing a line.

func NewLine

func NewLine(xys XYer) (*Line, error)

NewLine returns a Line that uses the default line style and does not draw glyphs.

func (*Line) DataRange

func (pts *Line) DataRange() (xmin, xmax, ymin, ymax float64)

DataRange returns the minimum and maximum x and y values, implementing the plot.DataRanger interface.

func (*Line) Plot

func (pts *Line) Plot(da plot.DrawArea, plt *plot.Plot)

Plot draws the Line, implementing the plot.Plotter interface.

func (*Line) Thumbnail

func (pts *Line) Thumbnail(da *plot.DrawArea)

Thumbnail the thumbnail for the Line, implementing the plot.Thumbnailer interface.

type QuartPlot

type QuartPlot struct {

	// Offset is added to the x location of each plot.
	// When the Offset is zero, the plot is drawn
	// centered at its x location.
	Offset vg.Length

	// MedianStyle is the line style for the median point.
	MedianStyle plot.GlyphStyle

	// WhiskerStyle is the line style used to draw the
	// whiskers.
	WhiskerStyle plot.LineStyle
	// contains filtered or unexported fields
}

QuartPlot implements the Plotter interface, drawing a plot to represent the distribution of values.

This style of the plot appears in Tufte's "The Visual Display of Quantitative Information".

func NewQuartPlot

func NewQuartPlot(loc float64, values Valuer) (*QuartPlot, error)

NewQuartPlot returns a new QuartPlot that represents the distribution of the given values.

An error is returned if the plot is created with no values.

The fence values are 1.5x the interquartile before the first quartile and after the third quartile. Any value that is outside of the fences are drawn as Outside points. The adjacent values (to which the whiskers stretch) are the minimum and maximum values that are not outside the fences.

func (*QuartPlot) DataRange

func (b *QuartPlot) DataRange() (float64, float64, float64, float64)

DataRange returns the minimum and maximum x and y values, implementing the plot.DataRanger interface.

func (*QuartPlot) GlyphBoxes

func (b *QuartPlot) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes returns a slice of GlyphBoxes for the plot, implementing the plot.GlyphBoxer interface.

func (*QuartPlot) OutsideLabels

func (b *QuartPlot) OutsideLabels(labels Labeller) (*Labels, error)

OutsideLabels returns a *Labels that will plot a label for each of the outside points. The labels are assumed to correspond to the points used to create the plot.

func (*QuartPlot) Plot

func (b *QuartPlot) Plot(da plot.DrawArea, plt *plot.Plot)

type Scatter

type Scatter struct {
	// XYs is a copy of the points for this scatter.
	XYs

	// GlyphStyle is the style of the glyphs drawn
	// at each point.
	plot.GlyphStyle
}

Scatter implements the Plotter interface, drawing a glyph for each of a set of points.

func NewScatter

func NewScatter(xys XYer) (*Scatter, error)

NewScatter returns a Scatter that uses the default glyph style.

func (*Scatter) DataRange

func (pts *Scatter) DataRange() (xmin, xmax, ymin, ymax float64)

DataRange returns the minimum and maximum x and y values, implementing the plot.DataRanger interface.

func (*Scatter) GlyphBoxes

func (pts *Scatter) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes returns a slice of plot.GlyphBoxes, implementing the plot.GlyphBoxer interface.

func (*Scatter) Plot

func (pts *Scatter) Plot(da plot.DrawArea, plt *plot.Plot)

Plot draws the Scatter, implementing the plot.Plotter interface.

func (*Scatter) Thumbnail

func (pts *Scatter) Thumbnail(da *plot.DrawArea)

Thumbnail the thumbnail for the Scatter, implementing the plot.Thumbnailer interface.

type Valuer

type Valuer interface {
	// Len returns the number of values.
	Len() int

	// Value returns a value.
	Value(int) float64
}

Valuer wraps the Len and Value methods.

type Values

type Values []float64

Values implements the Valuer interface.

func CopyValues

func CopyValues(vs Valuer) (Values, error)

CopyValues returns a Values that is a copy of the values from a Valuer, or an error if there are no values, or if one of the copied values is a NaN or Infinity.

func (Values) Len

func (vs Values) Len() int

func (Values) Value

func (vs Values) Value(i int) float64

type XErrorBars

type XErrorBars struct {
	XYs

	// XErrors is a copy of the X errors for each point.
	XErrors

	// LineStyle is the style used to draw the error bars.
	plot.LineStyle

	// CapWidth is the width of the caps drawn at the top
	// of each error bar.
	CapWidth vg.Length
}

XErrorBars implements the plot.Plotter, plot.DataRanger, and plot.GlyphBoxer interfaces, drawing horizontal error bars, denoting error in Y values.

func NewXErrorBars

func NewXErrorBars(xerrs interface {
	XYer
	XErrorer
}) (*XErrorBars, error)

Returns a new XErrorBars plotter, or an error on failure. The error values from the XErrorer interface are interpreted as relative to the corresponding X value. The errors for a given X value are computed by taking the absolute value of the error returned by the XErrorer and subtracting the first and adding the second to the X value.

func (*XErrorBars) DataRange

func (e *XErrorBars) DataRange() (xmin, xmax, ymin, ymax float64)

DataRange implements the plot.DataRanger interface.

func (*XErrorBars) GlyphBoxes

func (e *XErrorBars) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes implements the plot.GlyphBoxer interface.

func (*XErrorBars) Plot

func (e *XErrorBars) Plot(da plot.DrawArea, p *plot.Plot)

Plot implements the Plotter interface, drawing labels.

type XErrorer

type XErrorer interface {
	// XError returns two error values for X data.
	XError(int) (float64, float64)
}

XErrorer wraps the XError method.

type XErrors

type XErrors Errors

XErrors implements the XErrorer interface.

func (XErrors) XError

func (xe XErrors) XError(i int) (float64, float64)

type XValues

type XValues struct {
	XYer
}

XValues implements the Valuer interface, returning the x value from an XYer.

func (XValues) Value

func (xs XValues) Value(i int) float64

type XYValues

type XYValues struct{ XYZer }

XYValues implements the XYer interface, returning the x and y values from an XYZer.

func (XYValues) XY

func (xy XYValues) XY(i int) (float64, float64)

XY implements the XY method of the XYer interface.

type XYZer

type XYZer interface {
	// Len returns the number of x, y, z triples.
	Len() int

	// XYZ returns an x, y, z triple.
	XYZ(int) (float64, float64, float64)
}

XYZer wraps the Len and XYZ methods.

type XYZs

type XYZs []struct{ X, Y, Z float64 }

XYZs implements the XYZer interface using a slice.

func CopyXYZs

func CopyXYZs(data XYZer) (XYZs, error)

CopyXYZs copies an XYZer.

func (XYZs) Len

func (xyz XYZs) Len() int

Len implements the Len method of the XYZer interface.

func (XYZs) XYZ

func (xyz XYZs) XYZ(i int) (float64, float64, float64)

XYZ implements the XYZ method of the XYZer interface.

type XYer

type XYer interface {
	// Len returns the number of x, y pairs.
	Len() int

	// XY returns an x, y pair.
	XY(int) (x, y float64)
}

XYer wraps the Len and XY methods.

type XYs

type XYs []struct{ X, Y float64 }

XYs implements the XYer interface.

func CopyXYs

func CopyXYs(data XYer) (XYs, error)

CopyXYs returns an XYs that is a copy of the x and y values from an XYer, or an error if one of the data points contains a NaN or Infinity.

func (XYs) Len

func (xys XYs) Len() int

func (XYs) XY

func (xys XYs) XY(i int) (float64, float64)

type YErrorBars

type YErrorBars struct {
	XYs

	// YErrors is a copy of the Y errors for each point.
	YErrors

	// LineStyle is the style used to draw the error bars.
	plot.LineStyle

	// CapWidth is the width of the caps drawn at the top
	// of each error bar.
	CapWidth vg.Length
}

YErrorBars implements the plot.Plotter, plot.DataRanger, and plot.GlyphBoxer interfaces, drawing vertical error bars, denoting error in Y values.

func NewYErrorBars

func NewYErrorBars(yerrs interface {
	XYer
	YErrorer
}) (*YErrorBars, error)

Returns a new YErrorBars plotter, or an error on failure. The error values from the YErrorer interface are interpreted as relative to the corresponding Y value. The errors for a given Y value are computed by taking the absolute value of the error returned by the YErrorer and subtracting the first and adding the second to the Y value.

func (*YErrorBars) DataRange

func (e *YErrorBars) DataRange() (xmin, xmax, ymin, ymax float64)

DataRange implements the plot.DataRanger interface.

func (*YErrorBars) GlyphBoxes

func (e *YErrorBars) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox

GlyphBoxes implements the plot.GlyphBoxer interface.

func (*YErrorBars) Plot

func (e *YErrorBars) Plot(da plot.DrawArea, p *plot.Plot)

Plot implements the Plotter interface, drawing labels.

type YErrorer

type YErrorer interface {
	// YError returns two error values for Y data.
	YError(int) (float64, float64)
}

YErrorer wraps the YError method.

type YErrors

type YErrors Errors

YErrors implements the YErrorer interface.

func (YErrors) YError

func (ye YErrors) YError(i int) (float64, float64)

type YValues

type YValues struct {
	XYer
}

YValues implements the Valuer interface, returning the y value from an XYer.

func (YValues) Value

func (ys YValues) Value(i int) float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL