JuliaPlots / Plots.jl

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

GUI plots in IJulia #2355

Open sents opened 4 years ago

sents commented 4 years ago

Displaying plots in an extra window with gui does not work for IJulia with the PlotlyJS and PyPlot backends. In a jupyter-notebook the plot is displayed inline and for jupyer-console/jupyter-qtconsole gui doesn't do anything.

PyPlot gui can be manually activated by changing

ENV["MPLBACKENDS"] 

after loading Plots but before activating the pyplot backend and then calling

Plots.PyPlot.pygui(true)

However this doesn't work very well for me, as both the image and the interactive window are spawned when displaying the plot and displaying the plot again fails once the interactive window was closed.

Displaying the plot in a separate gui window can add interactivity features that might not be available inline for a specific backend (pyplot) or available at all for jupyter-(qt)console. Therefore it would be very helpful if the gui function would also work for IJulia and other environments. It is also not immediately clear from the documentation that gui is not working for IJulia.

Additionally it would be really nice if at some point users could switch the default display method between gui and inline. I am using Julia 1.3.0

ceesb commented 4 years ago

The work around you describe needs a restart of the kernel to switch between inline and popup plots, right? Do you know of a workaround to switch between inline and popup without a restart?