# Using PyPlot in JuliaPro

**URL:** <https://discourse.julialang.org/t/using-pyplot-in-juliapro/4689>\
**Category:** New to Julia\
**Created:** [July 6, 2017, 1:49pm UTC](https://discourse.julialang.org/t/using-pyplot-in-juliapro/4689 "2017-07-06T13:49:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philippe\_Maincon](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Philippe\_Maincon](https://discourse.julialang.org/u/Philippe_Maincon)\
**Post date:** [July 6, 2017, 1:49pm UTC](https://discourse.julialang.org/t/using-pyplot-in-juliapro/4689/1 "2017-07-06T13:49:19Z")

</div>

Hi

I am using JuliaPro on Windows 7, which runs Julia 0.5.1.  
If I paste

```julia
using Plots
pyplot() # Switch to using the PyPlot.jl backend
plot(rand(5,5),linewidth=2,title="My Plot B")

```

in the REPL, I get a new pane with a plot. If however I have the same code in a file and press “Run File”, the file is executed, but no plot appears. What did I miss?

---

<div class="post-metadata">

**Author:** ![Daneel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daneel/32/175_2.png) [@Daneel](https://discourse.julialang.org/u/Daneel)\
**Post date:** [July 7, 2017, 6:35am UTC](https://discourse.julialang.org/t/using-pyplot-in-juliapro/4689/2 "2017-07-07T06:35:10Z")

</div>

I’m not familiar with Plots but PyPlot has an interactive plotting setting which might be the cause of this. Does this work?

```julia
using Plots
ion() # Interactive Plotting ON
pyplot()
plot(rand(5,5),linewidth=2,title="My Plot B")

```

The opposite function is `ioff()`.

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Philippe\_Maincon](https://discourse.julialang.org/u/Philippe_Maincon)\
**Post date:** [July 7, 2017, 7:28am UTC](https://discourse.julialang.org/t/using-pyplot-in-juliapro/4689/3 "2017-07-07T07:28:59Z")

</div>

That didn’t work, unfortunately.

But I found an acceptable solution for now: if my script ends with  
`savefig("pyplot_test.png")`  
then JuliaPro opens a pane named `"pyplot_test.png"` which displays the plot.

Cheers!

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [July 7, 2017, 11:44am UTC](https://discourse.julialang.org/t/using-pyplot-in-juliapro/4689/4 "2017-07-07T11:44:29Z")

</div>

`Evaluate File` basically does the same as `include(file)` at the REPL, which doesn’t show plots (or output in general) either, except for the last line.  
Explicitly calling `display(plot(...))` or similar should work however (I didn’t test that with PyPlot though).
