NewLine returns a Line that uses the default line style and does not draw glyphs.
(xys XYer)
| 50 | // NewLine returns a Line that uses the default line style and |
| 51 | // does not draw glyphs. |
| 52 | func NewLine(xys XYer) (*Line, error) { |
| 53 | data, err := CopyXYs(xys) |
| 54 | if err != nil { |
| 55 | return nil, err |
| 56 | } |
| 57 | return &Line{ |
| 58 | XYs: data, |
| 59 | LineStyle: DefaultLineStyle, |
| 60 | }, nil |
| 61 | } |
| 62 | |
| 63 | // Plot draws the Line, implementing the plot.Plotter interface. |
| 64 | func (pts *Line) Plot(c draw.Canvas, plt *plot.Plot) { |