MCPcopy Create free account
hub / github.com/cogentcore/core / Plot

Method Plot

plot/plots/scatter.go:58–71  ·  view source on GitHub ↗

Plot draws the Line, implementing the plot.Plotter interface.

(plt *plot.Plot)

Source from the content-addressed store, hash-verified

56
57// Plot draws the Line, implementing the plot.Plotter interface.
58func (pts *Scatter) Plot(plt *plot.Plot) {
59 pc := plt.Paint
60 if !pts.LineStyle.SetStroke(plt) {
61 return
62 }
63 pts.PointSize.ToDots(&pc.UnitContext)
64 pc.FillStyle.Color = pts.LineStyle.Color
65 ps := plot.PlotXYs(plt, pts.XYs)
66 for i := range ps {
67 pt := ps[i]
68 DrawShape(pc, math32.Vec2(pt.X, pt.Y), pts.PointSize.Dots, pts.PointShape)
69 }
70 pc.FillStyle.Color = nil
71}
72
73// DataRange returns the minimum and maximum
74// x and y values, implementing the plot.DataRanger interface.

Callers

nothing calls this directly

Calls 5

PlotXYsFunction · 0.92
Vec2Function · 0.92
DrawShapeFunction · 0.85
SetStrokeMethod · 0.45
ToDotsMethod · 0.45

Tested by

no test coverage detected