plot: Can't change background and line color
Created by: MiguelPires
What are you trying to do?
Changing the background and line color of a plot.
What did you do?
graph, err := plot.New()
if err != nil {
return err
}
line, err := plotter.NewLine(dataPoints)
if err != nil {
return err
}
graph.HideAxes()
graph.BackgroundColor = color.RGBA{A: 0}
line.LineStyle.Color = color.RGBA{R: 0, G: 0, B: 237, A: 255}
err = plotutil.AddLines(graph, line)
if err != nil {
return err
}
err = graph.Save(6*vg.Centimeter, vg.Centimeter, path)
if err != nil {
return err
}
What did you expect to happen?
The background to be transparent and the line color to be blue.
What actually happened?
The image is created but the background is still white and the line color isn't blue.
What version of Go and Gonum/plot are you using?
Go: 1.8 gonum: 5f3c436c