Hello,
I am trying to get subplots to work with Plots.jl and pyplot backend. My workflow is as follows:
function my_plot()
...
scatter(...)
end
using Plots
pyplot()
p1 = my_plot(args1);
p2 = my_plot(args2);
plot(p1, p2, layout=(1, 2))
Note that lines that generate p1
and p2
end with semicolons. The plots pane in Atom is turned off.
When i run the entire snippet in Atom (using Ctrl-Shift-Enter), my plot with subplots shows up for a second, and is then replaced with p2. The same thing happens when I run last three lines from the snippet above (Ctrl-Enter). When I run the script from the command line (julia script_file.jl
) nothing shows up at all, the script just exits. The only way to get the correct plot (with two subplots) is to run the whole thing from Atom, close the figure window with the wrong plot, and then run just the single last line from the snippet.
Is this a bug in Plots.jl, and does anyone know of a workaround?
My matplotplibrc
:
interactive : False
backend : TkAgg
julia> versioninfo()
Julia Version 1.0.3
Platform Info:
OS: Linux (x86_64-conda_cos6-linux-gnu)
...
[91a5bcdd] Plots v0.23.2
[438e738f] PyCall v1.91.1
[d330b81b] PyPlot v2.8.0