# How to save two overlapped plots together in one single file?

**URL:** <https://discourse.julialang.org/t/how-to-save-two-overlapped-plots-together-in-one-single-file/89852>\
**Category:** General Usage\
**Tags:** question, plotting\
**Created:** [November 6, 2022, 11:14pm UTC](https://discourse.julialang.org/t/how-to-save-two-overlapped-plots-together-in-one-single-file/89852 "2022-11-06T23:14:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mzd1893](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mzd1893](https://discourse.julialang.org/u/mzd1893)\
**Post date:** [November 6, 2022, 11:14pm UTC](https://discourse.julialang.org/t/how-to-save-two-overlapped-plots-together-in-one-single-file/89852/1 "2022-11-06T23:14:54Z")

</div>

```julia
using Plots
plot(0:10,sin);
plot!(0:10,sin,seriestype = :scatter)

```

 ![mmexport1667776442350](https://global.discourse-cdn.com/julialang/original/3X/c/5/c53e6e04d7f6a7197614e58f270f98e4eef80f2d.png)

In this example, the output are actually two plots. How can I save them in one file?

---

<div class="post-metadata">

**Author:** ![tpolakovic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tpolakovic/32/8612_2.png) [@tpolakovic](https://discourse.julialang.org/u/tpolakovic)\
**Post date:** [November 7, 2022, 1:47am UTC](https://discourse.julialang.org/t/how-to-save-two-overlapped-plots-together-in-one-single-file/89852/2 "2022-11-07T01:47:25Z")

</div>

They are not two plots. It’s the same figure object.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [November 7, 2022, 2:26am UTC](https://discourse.julialang.org/t/how-to-save-two-overlapped-plots-together-in-one-single-file/89852/3 "2022-11-07T02:26:04Z")

</div>

> [@mzd1893](#):
>
> the output are actually two plots.

how did you save them?

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [November 7, 2022, 8:42am UTC](https://discourse.julialang.org/t/how-to-save-two-overlapped-plots-together-in-one-single-file/89852/4 "2022-11-07T08:42:51Z")

</div>

```julia
savefig("file.png")

```

does it. How did you get the picture you posted here?
