Plot draws the Line, implementing the plot.Plotter interface.
(plt *plot.Plot)
| 56 | |
| 57 | // Plot draws the Line, implementing the plot.Plotter interface. |
| 58 | func (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. |