JuliaPlots / Plots.jl

Powerful convenience for Julia visualizations and data analysis
https://docs.juliaplots.org
Other
1.84k stars 355 forks source link

Plots, gr() on JuliaBox #873

Open PaulSoderlind opened 7 years ago

PaulSoderlind commented 7 years ago

Just now on JuliaBox (using the 0.5.2 kernel), the following generates a lot of error messages:

using Plots
gr()
default(show=true)
plot(1:10)

The error messages are

GKS: can't open display on "" Is your DISPLAY environment variable set correctly? Did you enable X11 and TCP forwarding?... and lots more

Commenting out default(show=true) solves the problem

If this is the intended result (it should all be inline in IJulia?), then the documentation should perhaps mention it.

/Paul S

mkborregaard commented 7 years ago

I guess it should be. You're telling GR to plot the GKSterm instead of to the notebook.

mkborregaard commented 7 years ago

In many cases you get the best behaviour in IPython with default(show=:ijulia). This could definitely be better documented.

PaulSoderlind commented 7 years ago

I just tried this in a Jupyter notebook 0.5.2 (Win7 and also on JuliaBox):

using Plots
gr()
default(show=:ijulia)
x = linspace(-3,3,20)                 #create some "data" to plot
y = 2*x.^2 + 0.5
plot(x,y)

It showed two identical plots.