How to re-draw a plot with PyPlot

I can create a plot with PyPlot:

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:

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.

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

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