Change pandas plot background color

background, colors, matplotlib, pandas, python

Solution

`plot()` in `pandas` are build on `matplotlib`. The right way is just to access the plot axes object and change its bgcolor: change the lastlines to:

P=gs.plot()
P.set_axis_bgcolor('g') #or any HTML colorcode, (R,G,B) tuple, (R,G,B,A) tuple, etcetc.

Problem

Is it possible to change the background in a pandas chart? I would like to change the background from white and the line to orange but I cannot find any documentation to do that. I am using the pandas as follows: ``` import pandas.io.data as web import numpy as np gs = web.get_data_yahoo('gs')['Close'] gs = gs.pct_change() gs.plot() ``` Is it possible to change the background to black or any other color?

Original source