# PyPlot set facecolor

**URL:** https://discourse.julialang.org/t/pyplot-set-facecolor/39794
**Category:** Visualization
**Created:** [May 20, 2020, 1:10am UTC](https://discourse.julialang.org/t/pyplot-set-facecolor/39794 "2020-05-20T01:10:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![qwerytyui1234](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qwerytyui1234/32/31952_2.png) [@qwerytyui1234](https://discourse.julialang.org/u/qwerytyui1234)
#### Post date: [May 20, 2020, 1:10am UTC](https://discourse.julialang.org/t/pyplot-set-facecolor/39794/1 "2020-05-20T01:10:34Z")

</div>

Can anyone get this code to work?

```julia
using Plots
pyplot()
fig, ax = PyPlot.subplots(facecolor=(0.5,0.2,0.5)) 
ax.plot(rand(10))
fig 

```

This code runs without any error message, but for some reason the background color for the fig object does not change.

I’m using Atom and Julia version 1.4.0 and using latest version of all the packages. MatPlotlib from PyCall shows version 3.0.3. If anybody could help with this issue, it would be great.

---

<div class="post-metadata">

### Author: ![josephmarturano](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@josephmarturano](https://discourse.julialang.org/u/josephmarturano)
#### Post date: [May 20, 2020, 5:57pm UTC](https://discourse.julialang.org/t/pyplot-set-facecolor/39794/2 "2020-05-20T17:57:55Z")

</div>

Two ideas for you:

1. Using Plots and the PyPlot backend:

```julia
using Plots
pyplot()
plot(rand(10), background_color =RGB(0.5,0.2,0.5))

```

1. Using PyPlot directly:

```julia
using PyPlot
fig, ax = PyPlot.subplots() 
ax.set_facecolor((0.5,0.2,0.5))
ax.plot(rand(10))
fig

```
