When running julia REPL from the command line and copy-pasting my script, the Gadfly plot command works as expected.
But, when running julia -i scriptname.jl plot no longer works and prints:
julia> DataFrame(CSV.File("file.csv"))
julia> plot(massdf, x=:date, y=:mass, group=:day, color=:day, Geom.line)
Plot(...)
julia>
Is there a setting needed to make it work?
You need to explicitly display the output of
plot()in your script (which is done implicitly in a Read-Eval-Print-Loop but not when the whole script is executed, even with-i).Use
display(p::Plot), ordraw(backend::Compose.Backend, p::Plot):See also Gadfly Backends.