# With Jupyter new figures keeps the print of the former figure

**URL:** https://discourse.julialang.org/t/with-jupyter-new-figures-keeps-the-print-of-the-former-figure/96182
**Category:** New to Julia
**Tags:** plots
**Created:** [March 16, 2023, 12:39pm UTC](https://discourse.julialang.org/t/with-jupyter-new-figures-keeps-the-print-of-the-former-figure/96182 "2023-03-16T12:39:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Emmanuel\_Fontaine](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/emmanuel_fontaine/32/47737_2.png) [@Emmanuel\_Fontaine](https://discourse.julialang.org/u/Emmanuel_Fontaine)
#### Post date: [March 16, 2023, 12:39pm UTC](https://discourse.julialang.org/t/with-jupyter-new-figures-keeps-the-print-of-the-former-figure/96182/1 "2023-03-16T12:39:27Z")

</div>

Hi all,

I’m testing scatter plots from Plots GR. I made three differents plots changing the size and colormap properties to have a look on their impact.That’s ok.

But I realize that the second plot add the new plot to the first and then the third plot add its own plot to the second and first one.  
How do I avoid that If I want to keep the same document (i.e the joint picture).

 ![Capture d’écran du 2023-03-16 13-39-01](https://global.discourse-cdn.com/julialang/original/3X/9/2/925d56d7a0532dfc5ba271dbd5c89f0d8edd7f8c.png)

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [March 16, 2023, 12:41pm UTC](https://discourse.julialang.org/t/with-jupyter-new-figures-keeps-the-print-of-the-former-figure/96182/2 "2023-03-16T12:41:43Z")

</div>

`scatter!` appends to the last figure (or the one you provide as a first argument)  
use `scatter` to start a new figure.

_edit:_ Was not so easy to find for `scatter` but is explained for `plot` here [Basics · Plots](https://docs.juliaplots.org/latest/basics/) in the very beginning, both `plot!` and `scatter!` add to `current()` by default.

---

<div class="post-metadata">

### Author: ![Emmanuel\_Fontaine](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/emmanuel_fontaine/32/47737_2.png) [@Emmanuel\_Fontaine](https://discourse.julialang.org/u/Emmanuel_Fontaine)
#### Post date: [March 16, 2023, 12:44pm UTC](https://discourse.julialang.org/t/with-jupyter-new-figures-keeps-the-print-of-the-former-figure/96182/3 "2023-03-16T12:44:00Z")

</div>

This is great thank you. I ssume that ! has the same use for all plot function then.

E.F

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [March 16, 2023, 12:45pm UTC](https://discourse.julialang.org/t/with-jupyter-new-figures-keeps-the-print-of-the-former-figure/96182/4 "2023-03-16T12:45:57Z")

</div>

Yes, that is a unified design principle.

Oh – and since I just saw that – Weolcome to the Julia Discourse Forum! 👋
