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

**URL:** https://discourse.julialang.org/t/how-can-i-clear-i-e-not-overlay-my-plot-in-atom/35861
**Category:** General Usage
**Tags:** question, plotting
**Created:** [March 12, 2020, 1:06am UTC](https://discourse.julialang.org/t/how-can-i-clear-i-e-not-overlay-my-plot-in-atom/35861 "2020-03-12T01:06:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Farhan\_Samir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/farhan_samir/32/13005_2.png) [@Farhan\_Samir](https://discourse.julialang.org/u/Farhan_Samir)
#### Post date: [March 12, 2020, 1:06am UTC](https://discourse.julialang.org/t/how-can-i-clear-i-e-not-overlay-my-plot-in-atom/35861/1 "2020-03-12T01:06:27Z")

</div>

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](https://global.discourse-cdn.com/julialang/original/3X/a/4/a44de93e89cc0a3c78df1f095da9451ed2c3716e.png)

I’m using the `GR` backend.

---

<div class="post-metadata">

### Author: ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)
#### Post date: [March 12, 2020, 1:38am UTC](https://discourse.julialang.org/t/how-can-i-clear-i-e-not-overlay-my-plot-in-atom/35861/2 "2020-03-12T01:38:04Z")

</div>

Welcome to Discourse!

Can you post a minimal working code example?

---

<div class="post-metadata">

### Author: ![Farhan\_Samir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/farhan_samir/32/13005_2.png) [@Farhan\_Samir](https://discourse.julialang.org/u/Farhan_Samir)
#### Post date: [March 12, 2020, 2:59pm UTC](https://discourse.julialang.org/t/how-can-i-clear-i-e-not-overlay-my-plot-in-atom/35861/3 "2020-03-12T14:59:35Z")

</div>

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

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

```

which I changed to

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

```

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