Documentation ¶
Overview ¶
Package plotter defines a variety of standard Plotters for the 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 ¶
- Variables
- func CheckFloats(fs ...float32) error
- func Inf(sign int) float32
- func IsInf(f float32, sign int) bool
- func IsNaN(sign float32) bool
- func Max(x, y float32) float32
- func Min(x, y float32) float32
- func Range(vs Valuer) (min, max float32)
- func XYRange(xys XYer) (xmin, xmax, ymin, ymax float32)
- type Errors
- type Labeller
- type Valuer
- type Values
- type XErrorer
- type XErrors
- type XValues
- type XY
- type XYValues
- type XYZ
- type XYZer
- type XYZs
- type XYer
- type XYs
- type YErrorer
- type YErrors
- type YValues
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultLineStyle is the default style for drawing // lines. DefaultLineStyle = draw.LineStyle{ Color: color.Black, Width: vg.Points(1), Dashes: []vg.Length{}, DashOffs: 0, } // DefaultGlyphStyle is the default style used // for gyph marks. DefaultGlyphStyle = draw.GlyphStyle{ Color: color.Black, Radius: vg.Points(2.5), Shape: draw.RingGlyph{}, } )
Functions ¶
func CheckFloats ¶
CheckFloats returns an error if any of the arguments are NaN or Infinity.
Types ¶
type Errors ¶
type Errors []struct{ Low, High float32 }
Errors is a slice of low and high error values.
type Valuer ¶
type Valuer interface { // Len returns the number of values. Len() int // Value returns a value. Value(int) float32 }
Valuer wraps the Len and Value methods.
type Values ¶
type Values []float32
Values implements the Valuer interface.
func CopyValues ¶
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.
type XErrorer ¶
type XErrorer interface { // XError returns two error values for X data. XError(int) (float32, float32) }
XErrorer wraps the XError method.
type XValues ¶
type XValues struct {
XYer
}
XValues implements the Valuer interface, returning the x value from an XYer.
type XYValues ¶
type XYValues struct{ XYZer }
XYValues implements the XYer interface, returning the x and y values from an XYZer.
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) (float32, float32, float32) // XY returns an x, y pair. XY(int) (float32, float32) }
XYZer wraps the Len and XYZ methods.
type XYZs ¶
type XYZs []XYZ
XYZs implements the XYZer interface using a slice.
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 float32) }
XYer wraps the Len and XY methods.
type XYs ¶
type XYs []XY
XYs implements the XYer interface.
type YErrorer ¶
type YErrorer interface { // YError returns two error values for Y data. YError(int) (float32, float32) }
YErrorer wraps the YError method.