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

Function NewFunction

plotter/functions.go:29–35  ·  view source on GitHub ↗

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

(f func(float64) float64)

Source from the content-addressed store, hash-verified

27// NewFunction returns a Function that plots F using
28// the default line style with 50 samples.
29func NewFunction(f func(float64) float64) *Function {
30 return &Function{
31 F: f,
32 Samples: 50,
33 LineStyle: DefaultLineStyle,
34 }
35}
36
37// Plot implements the Plotter interface, drawing a line
38// that connects each point in the Line.

Callers 11

TestDrawGlyphBoxesFunction · 0.92
Example_logScaleFunction · 0.92
Example_invertedScaleFunction · 0.92
ExampleFunctionFunction · 0.92
TestLabelsWithGlyphBoxesFunction · 0.92
ExampleHistogramFunction · 0.92
TestMultiCanvasFunction · 0.92
Example_inMemoryCanvasFunction · 0.92
Example_writerToCanvasFunction · 0.92
TestLineLatexFunction · 0.92

Calls

no outgoing calls

Tested by 11

TestDrawGlyphBoxesFunction · 0.74
Example_logScaleFunction · 0.74
Example_invertedScaleFunction · 0.74
ExampleFunctionFunction · 0.74
TestLabelsWithGlyphBoxesFunction · 0.74
ExampleHistogramFunction · 0.74
TestMultiCanvasFunction · 0.74
Example_inMemoryCanvasFunction · 0.74
Example_writerToCanvasFunction · 0.74
TestLineLatexFunction · 0.74