MCPcopy
hub / github.com/gonum/plot / WriterTo

Method WriterTo

plot.go:504–511  ·  view source on GitHub ↗

WriterTo returns an io.WriterTo that will write the plot as the specified image format. Supported formats are: - .eps - .jpg|.jpeg - .pdf - .png - .svg - .tex - .tif|.tiff

(w, h vg.Length, format string)

Source from the content-addressed store, hash-verified

502// - .tex
503// - .tif|.tiff
504func (p *Plot) WriterTo(w, h vg.Length, format string) (io.WriterTo, error) {
505 c, err := draw.NewFormattedCanvas(w, h, format)
506 if err != nil {
507 return nil, err
508 }
509 p.Draw(draw.New(c))
510 return c, nil
511}
512
513// Save saves the plot to an image file. The file format is determined
514// by the extension.

Callers 3

SaveMethod · 0.95
TestSingletonHistogramFunction · 0.80
TestLineWidthFunction · 0.80

Calls 3

DrawMethod · 0.95
NewFormattedCanvasFunction · 0.92
NewFunction · 0.92

Tested by 2

TestSingletonHistogramFunction · 0.64
TestLineWidthFunction · 0.64