JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
475 stars 87 forks source link

Pluto & PyPlot.jl `imshow` #530

Open roflmaostc opened 3 years ago

roflmaostc commented 3 years ago

Hey,

I've seen that PyPlot.jl in general works, but in Pluto nothing really happens for:

begin
    using PyPlot
    PyPlot.imshow(randn((3,3)))
end

Only some output:

PyObject <matplotlib.image.AxesImage object at 0x7f08ddf99700>

In the REPL that pops-up an external, interactive viewer. In Jupyter it is within the browser, but I would be happy to have it externally.

Thanks a lot,

Felix

Setup:

Ref: Pluto issue

diegozea commented 3 years ago

Hi!

It would be great to have plot and imshow working out of the box in Pluto!

For the moment, I have found the following workaround using gcf to get a Figure object:

import PyPlot

begin
    PyPlot.figure()
    PyPlot.imshow(randn((3,3)))
    PyPlot.gcf()
end

Screenshot from 2021-09-10 16-00-29

Best!