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

Function CopyValues

plotter/plotter.go:91–103  ·  view source on GitHub ↗

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.

(vs Valuer)

Source from the content-addressed store, hash-verified

89// from a Valuer, or an error if there are no values, or if one of
90// the copied values is a NaN or Infinity.
91func CopyValues(vs Valuer) (Values, error) {
92 if vs.Len() == 0 {
93 return nil, ErrNoData
94 }
95 cpy := make(Values, vs.Len())
96 for i := range vs.Len() {
97 cpy[i] = vs.Value(i)
98 if err := CheckFloats(cpy[i]); err != nil {
99 return nil, err
100 }
101 }
102 return cpy, nil
103}
104
105func (vs Values) Len() int {
106 return len(vs)

Callers 2

newFiveStatFunction · 0.85
NewBarChartFunction · 0.85

Calls 3

CheckFloatsFunction · 0.85
LenMethod · 0.65
ValueMethod · 0.65

Tested by

no test coverage detected