SVGToFile saves the SVG to given file
(filename string)
| 39 | |
| 40 | // SVGToFile saves the SVG to given file |
| 41 | func (pt *Plot) SVGToFile(filename string) error { |
| 42 | fp, err := os.Create(filename) |
| 43 | if err != nil { |
| 44 | return err |
| 45 | } |
| 46 | defer fp.Close() |
| 47 | bw := bufio.NewWriter(fp) |
| 48 | pt.Paint.SVGOut = bw |
| 49 | pt.svgDraw() |
| 50 | pt.Paint.SVGOut = nil |
| 51 | return bw.Flush() |
| 52 | } |
| 53 | |
| 54 | // drawConfig configures everything for drawing |
| 55 | func (pt *Plot) drawConfig() { |