Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying plots in vscode #576

Open
CNelias opened this issue Jan 10, 2024 · 2 comments
Open

Displaying plots in vscode #576

CNelias opened this issue Jan 10, 2024 · 2 comments

Comments

@CNelias
Copy link

CNelias commented Jan 10, 2024

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.

@stevengj
Copy link
Member

stevengj commented Jan 10, 2024

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

@stevengj stevengj changed the title Plot not showing up in plot panel Displaying plots in vscode Jan 10, 2024
@stevengj
Copy link
Member

(See also #530.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants