Plots with Julia-0.6

I simultaneously upgraded to MacOS Sierra (the latest) and Julia 0.6, on a clean install. I’m trying to get my atom-juno-julia system to run as before, but am encountering problems plotting.

Let’s say, I run Chris’s code here: Julia live plot with atom - Stack Overflow

in a new atom-juno session in the console:

using Plots
gr(reuse=true)
p =plot([0;.1],[0;.2])
gui()
for i=2:10
  push!(p,i*.1,randn())
  gui()
  sleep(.1) # To slow things down for show.
end

gives me a crash, e.g.

2017-07-12 17:05:49.273 julia[5502:19517] Launching GKSTerm failed.

I’ve tried various backends, with examples from Plots.jl and nothing works. Sometimes I just get nothing, sometimes I get that Julia has stopped.

I have installed x-code and run Pkg.update().

Any suggestions? Thanks!

Have you tried:

  • using one of the backends direktly? using PyPlot; plot(1:3)
  • master: Pkg.checkout("Plots")

If you’re okay with using the build-in plot pane, then something like

using Plots
gr()
p = plot([0;.1],[0;.2])
for i=2:10
  push!(p,i*.1,randn())
  display(p)
  sleep(.1) # To slow things down for show.
end

works fine for me.

Thanks Mauro, thanks Seb,

I managed to fix the GR backend with the following:

sudo rm -rf /usr/local/gr
ENV["GRDIR"]=""
Pkg.build("GR")

as suggested here:
https://github.com/jheinen/GR.jl/issues/46

I’m not sure what happened, but I also had to run

Pkg.build("PyPlot")

And both GR and PyPlot are working now. Thanks!