I'm experimenting with ggplot's port for Python. I can do very basic graphics without too much trouble, but it gets really complicated for me when trying some more fancy.
In this case, I want to plot 3 variables A, B and C at the same time along 'x', which can be done with the simple code below. However, I'd like to display a 4th variable (called 'Back') in the background of the display, as a series of rectangular shaped colours (using a colour gradient of sort). Something that could look a little bit like this admitibly bad photoshop mockup :
Is there a straightforward way to accomplish this kind of graphic with ggplot for python?
If it could help answer the question, here is the xls file containing the data: https://dl.dropboxusercontent.com/u/73950/B.xls
And here is the code:
from ggplot import *
import pandas as pd
import statsmodels
xl = pd.ExcelFile('B.xls')
df = xl.parse("sheet1")
df_lng = pd.melt(df[['x', 'A', 'B', 'C','Back']], id_vars='x')
print ggplot(aes(x='x', y='value', colour='variable'), data=df_lng) + geom_line()
plt.show(1)
Oh, and here is a post that I think could help do the trick. This was done in R though... https://gist.github.com/dsparks/3866629
Here's the R code to do this. Don't know how to do it with Python, but it appears that this would be similar.