0
votes

I'm trying to show a figure in a window like Matlab figures ot matplotlib figures in Python. I am using the Plots.jl package with the Pyplot backend.

I can save my plots as svg or png files, but i do not know ho to show them interactively using IJulia or Julia REPL.

Thank you for your time.

1
@PaulH that is false, Plots.jl does lots of interactivity.Chris Rackauckas
@jdv Those other issues aren't relevant here. Those issues have to do with interactive Plotly plots going away after you close a notebook and open it back up. First of all, that's the Plotly backend and not the PyPlot backend. Secondly, that's not that it's non-interactive, it's that the plot doesn't come back after the notebook is re-opened (i.e. it'll work until you close the notebook). That's really not relevant here so I assume you're trolling? Please point to a single issue on rendering PyPlot plots in Jupyter notebooks, because there's not one in the Plots.jl repo.Chris Rackauckas
@ChrisRackauckas "Trolling?" Really? Show me on this StackOverflow doll where I "trolled" anyone. I'm pointing out that some research, not shown here, suggests that similar problems are reported in the very places that hosts the software under discussion (I mention IJulia specifically, but it was actually one of the silly "py" and "plot" named sites as well). I'm not sure why a completely reasonable and otherwise neutral statement could be possibly interpreted as trolling, but knock yourself out.user1531971
Can you show your "research"? Please point to an open issue. You keep mentioning that there's all of these problems out there but refuse to actually share concrete information about it. The issues here don't show plotting rendering issues with Plots+PyPlot. The Plots.jl page has one rendering issue which comes from a non-standard installation.Chris Rackauckas
@PaulH the docs have been updated so it's more clear that PyPlot is interactive. Hope that helps.Chris Rackauckas

1 Answers

3
votes

The simple plot(...) command will open an interactive window when used from the REPL when using the PyPlot backend. All you have to do is choose that backend, for example:

using Plots
pyplot() # backend choice
plot(rand(10,10))

For IDEs like Juno or VSCode that have a plot window, a PNG is displayed by default but you can open up the interactive window via the gui() command. In IJulia static PNGs are displayed, and currently the gui command is disabled there and so until that's re-enabled I'd recommend the REPL for interactive plots from PyPlot.