# Graph doesn't display in Julia Notebook (VSCode) using PyPlot

**URL:** <https://discourse.julialang.org/t/graph-doesnt-display-in-julia-notebook-vscode-using-pyplot/111150>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [March 4, 2024, 7:27pm UTC](https://discourse.julialang.org/t/graph-doesnt-display-in-julia-notebook-vscode-using-pyplot/111150 "2024-03-04T19:27:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matheus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matheus/32/206186_2.png) [@Matheus](https://discourse.julialang.org/u/Matheus)\
**Post date:** [March 4, 2024, 7:27pm UTC](https://discourse.julialang.org/t/graph-doesnt-display-in-julia-notebook-vscode-using-pyplot/111150/1 "2024-03-04T19:27:57Z")

</div>

I’m having trouble in making the following code work

```julia
using PyPlot

plot(rand(10))

```

The output I get is:  
1-element Vector{PyCall.PyObject}:  
PyObject \<matplotlib.lines.Line2D object at 0x000001B97E679030\>

If I use the browser (IJulia package) the graph displays correctly. I’m not sure why, when working on VSCode notebook, I receive this text message instead. Is it possible to fix it? Or is it intentional?

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [March 5, 2024, 8:53am UTC](https://discourse.julialang.org/t/graph-doesnt-display-in-julia-notebook-vscode-using-pyplot/111150/2 "2024-03-05T08:53:41Z")

</div>

Could you explain how you are using VS Code? I’m my sure what you mean by VS Code notebook.

A screenshot might help.

---

<div class="post-metadata">

**Author:** ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Post date:** [March 5, 2024, 9:03am UTC](https://discourse.julialang.org/t/graph-doesnt-display-in-julia-notebook-vscode-using-pyplot/111150/3 "2024-03-05T09:03:41Z")

</div>

Do

```julia
using PyPlot
plot(rand(10))
display(gcf())

```

---

<div class="post-metadata">

**Author:** ![Matheus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matheus/32/206186_2.png) [@Matheus](https://discourse.julialang.org/u/Matheus)\
**Post date:** [March 5, 2024, 4:55pm UTC](https://discourse.julialang.org/t/graph-doesnt-display-in-julia-notebook-vscode-using-pyplot/111150/4 "2024-03-05T16:55:12Z")

</div>

I’m sorry. I don’t know how to grab these specifications, here’s the print:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/2/a22f20c01b06de79241de791b63e2cc5c15f8053.png)

---

<div class="post-metadata">

**Author:** ![Matheus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matheus/32/206186_2.png) [@Matheus](https://discourse.julialang.org/u/Matheus)\
**Post date:** [March 5, 2024, 4:56pm UTC](https://discourse.julialang.org/t/graph-doesnt-display-in-julia-notebook-vscode-using-pyplot/111150/5 "2024-03-05T16:56:04Z")

</div>

Thank you very much, it worked perfectly.  
Could please explain the reason behind it?

---

<div class="post-metadata">

**Author:** ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Post date:** [March 5, 2024, 5:48pm UTC](https://discourse.julialang.org/t/graph-doesnt-display-in-julia-notebook-vscode-using-pyplot/111150/6 "2024-03-05T17:48:27Z")

</div>

No, not well. We should probably ask the VScode crowd.
