How to save a Gadfly.jl chart without displaying

using Gadfly
myplot = plot(x = 1:10, y = 2:11, Geom.line)
draw(PNG("myplot.png", 3inch, 3inch), myplot)

I just want to make a png file without displaying anything in browsers. (Why? For example, I work on a remote server.) How can I stop a function plotfrom displaying a shape?

+4
source share
1 answer

Nevermind I just found out the answer at https://github.com/dcjones/Gadfly.jl/issues/479 .

I need to add a semicolon to the end of the line, for example.

myplot = plot(x = 1:10, y = 2:11, Geom.line);
draw(PNG("myplot.png", 3inch, 3inch), myplot)
+4
source

All Articles