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

Function CopyXYs

plotter/plotter.go:139–148  ·  view source on GitHub ↗

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.

(data XYer)

Source from the content-addressed store, hash-verified

137// an XYer, or an error if one of the data points contains a NaN or
138// Infinity.
139func CopyXYs(data XYer) (XYs, error) {
140 cpy := make(XYs, data.Len())
141 for i := range cpy {
142 cpy[i].X, cpy[i].Y = data.XY(i)
143 if err := CheckFloats(cpy[i].X, cpy[i].Y); err != nil {
144 return nil, err
145 }
146 }
147 return cpy, nil
148}
149
150func (xys XYs) Len() int {
151 return len(xys)

Callers 6

NewLineFunction · 0.85
NewPolygonFunction · 0.85
NewScatterFunction · 0.85
NewLabelsFunction · 0.85
NewYErrorBarsFunction · 0.85
NewXErrorBarsFunction · 0.85

Calls 3

CheckFloatsFunction · 0.85
LenMethod · 0.65
XYMethod · 0.65

Tested by

no test coverage detected