How can I clear (i.e., not overlay) my plot in Atom?

If I understand correctly, using plot(...) as opposed to plot!(...) should replace the contents of the old plot with the new. I’m using the former to create plots but they seem to be overlayed for some reason, and I can’t find a simple way to clear the state of the plot without restarting Julia.

likelihood_contour

I’m using the GR backend.

Welcome to Discourse!

Can you post a minimal working code example?

1 Like

Thank you for your prompt response. I realize it was because I originally had this code:

p1 = contour!(x, y, z, fill=false, levels=levels)
plot!(p1)

which I changed to

p1 = contour!(x, y, z, fill=false, levels=levels)
plot(p1)

However, I neglected changing the contour! to contour which was causing the issue.

1 Like