PyPlot.jl icon indicating copy to clipboard operation
PyPlot.jl copied to clipboard

Displaying plots in vscode

Open CNelias opened this issue 1 year ago • 2 comments
trafficstars

Whenever I try to plot something using PyPlot.jl, nothing is displayed and only a 1-element Vector{PyCall.PyObject}: PyObject <matplotlib.lines.Line2D object at 0x00000274756122C0> element is returned.

I also tried p = plot(...); show(p), and p = plot(...); display(p) but I get nothing.

Plotting with Plots.jl works fine though. Is this a known issue or did I miss something?

I am running julia with vs code, I have julia 1.10 and the latest version of pyplot.jl.

CNelias avatar Jan 10 '24 09:01 CNelias

You need to display the Figure object. Use gcf() after your plot command (which returns the current figure object), or display(gcf()).

stevengj avatar Jan 10 '24 17:01 stevengj

(See also #530.)

stevengj avatar Jan 10 '24 17:01 stevengj