# Save figure with transparent background color in Plots.jl

**URL:** https://discourse.julialang.org/t/save-figure-with-transparent-background-color-in-plots-jl/18808
**Category:** General Usage
**Tags:** package, plotting, plots
**Created:** [December 18, 2018, 8:35pm UTC](https://discourse.julialang.org/t/save-figure-with-transparent-background-color-in-plots-jl/18808 "2018-12-18T20:35:49Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Shunsuke-Hori](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shunsuke-hori/32/3732_2.png) [@Shunsuke-Hori](https://discourse.julialang.org/u/Shunsuke-Hori)
#### Post date: [December 18, 2018, 9:56pm UTC](https://discourse.julialang.org/t/save-figure-with-transparent-background-color-in-plots-jl/18808/3 "2018-12-18T21:56:17Z")

</div>

@sswatson Thank you for the help.

It seems to work for `.png` but not for `.pdf`.

I tried the following code and got nice png and black background pdf.

```julia
using Plots
p=plot([1,2,3], background_color=:transparent, foreground_color=:black)
savefig(p, "test.png") # work nicely
savefig(p, "test.pdf") # not work

```

---

_[View the full topic](https://discourse.julialang.org/t/save-figure-with-transparent-background-color-in-plots-jl/18808)._
