GiovineItalia / Gadfly.jl

Crafty statistical graphics for Julia.
http://gadflyjl.org/stable/
Other
1.9k stars 251 forks source link

Gadfly plots disappear after reopen the notebook in IJulia? #1145

Open xiaohk opened 6 years ago

xiaohk commented 6 years ago

I am using Gadfly in Jupyter with Ijulia notebook. I can use draw(SVG(25cm, 10cm), p1) to display the plot in Jupyter, but I found it is not displayed in the out[] cell. So when I restart the kernel, all Gadfly plots disappear.

I am wondering if there is a way to disable the interactivity of Gadfly, and output the plot into out[]?

Edit: See the update

bjarthur commented 6 years ago

this is not a problem for me on OS X. draw does indeed not appear in an out[] cell, but those plots do re-appear after i restart the kernel.

to make plots appear in an out[] cell, use render(p1) instead, or just p1.

worth noting the the full interactivity of Gadlfy is achieved with SVGJS as in the title of this issue, not SVG as in the example provided in the first comment by the OP.

xiaohk commented 6 years ago

Sorry I didn't express it clearly. My main problem is plots will disappear after I reopen the notebook. It happens only to my notebook with many plots.

The original plot looks like,

image

After reopen the notebook, it becomes,

image

I first thought it is because I was using draw(SVG(25cm, 10cm), p1) which didn't output to out[] cell. I have tried to use p1 to render it, but the plot disappears after I reopen the notebook as well.

tlnagy commented 6 years ago

If you open the notebook in a text editor, can you see the SVG code in the cell? It should start with something like <svg xmlns="http://www.w3.org/2000/svg" My first guess is this is a problem with IJulia's rendering, not a Gadfly problem.

bjarthur commented 6 years ago

my plots are still there when i reopen the notebook, even after restarting the kernel. are you on linux, mac or windows? have you tried render(p1) or just p1 ?