# How to re-draw a plot with PyPlot

**URL:** <https://discourse.julialang.org/t/how-to-re-draw-a-plot-with-pyplot/111701>\
**Category:** Visualization\
**Tags:** question, package, pyplot\
**Created:** [March 16, 2024, 4:31pm UTC](https://discourse.julialang.org/t/how-to-re-draw-a-plot-with-pyplot/111701 "2024-03-16T16:31:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [March 16, 2024, 4:31pm UTC](https://discourse.julialang.org/t/how-to-re-draw-a-plot-with-pyplot/111701/1 "2024-03-16T16:31:32Z")

</div>

I can create a plot with PyPlot:

```julia
using PyPlot

fig=figure("first")
X = 0:0.1:2pi
Y = sin.(X)
p = plot(X, Y)

```

But after closing the PyPlot window I cannot get it back.

I tried:

```julia
p
display(p)
show(p)
fig
display(fig)
show(fig)

```

But I doesn’t work.

Any idea?

Using a REPL on Linux with Julia 1.10.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [March 16, 2024, 5:42pm UTC](https://discourse.julialang.org/t/how-to-re-draw-a-plot-with-pyplot/111701/2 "2024-03-16T17:42:25Z")

</div>

OK, I created a package that adds this (and other) features: [GitHub - aenarete/PyPlotX.jl: Plot functions for controller design](https://github.com/aenarete/PyPlotX.jl)

This is just a proof-of-concept. I hope that I am not re-inventing the wheel.
