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

Method Add

plot.go:124–136  ·  view source on GitHub ↗

Add adds a Plotters to the plot. If the plotters implements DataRanger then the minimum and maximum values of the X and Y axes are changed if necessary to fit the range of the data. When drawing the plot, Plotters are drawn in the order in which they were added to the plot.

(ps ...Plotter)

Source from the content-addressed store, hash-verified

122// When drawing the plot, Plotters are drawn in the
123// order in which they were added to the plot.
124func (p *Plot) Add(ps ...Plotter) {
125 for _, d := range ps {
126 if x, ok := d.(DataRanger); ok {
127 xmin, xmax, ymin, ymax := x.DataRange()
128 p.X.Min = math.Min(p.X.Min, xmin)
129 p.X.Max = math.Max(p.X.Max, xmax)
130 p.Y.Min = math.Min(p.Y.Min, ymin)
131 p.Y.Max = math.Max(p.Y.Max, ymax)
132 }
133 }
134
135 p.plotters = append(p.plotters, ps...)
136}
137
138// Draw draws a plot to a draw.Canvas.
139//

Callers 15

TestIssue514Function · 0.45
TestDrawGlyphBoxesFunction · 0.45
GlyphBoxesMethod · 0.45
GlyphBoxesMethod · 0.45
DrawGlyphBoxesMethod · 0.45
initFunction · 0.45
ExampleLabelsFunction · 0.45
ExampleContourFunction · 0.45
TestFieldDimsFunction · 0.45
ExampleScatter_colorFunction · 0.45
ExampleBoxPlotFunction · 0.45

Calls 3

DataRangeMethod · 0.65
MinMethod · 0.65
MaxMethod · 0.65

Tested by 15

TestIssue514Function · 0.36
TestDrawGlyphBoxesFunction · 0.36
ExampleLabelsFunction · 0.36
ExampleContourFunction · 0.36
TestFieldDimsFunction · 0.36
ExampleScatter_colorFunction · 0.36
ExampleBoxPlotFunction · 0.36
ExampleQuartPlotFunction · 0.36
ExampleFieldFunction · 0.36
ExampleField_colorsFunction · 0.36
ExampleField_gophersFunction · 0.36