Examples
Draw an area plot based on basic business metrics:
import numpy as np
import pandas as pd
df = pd.DataFrame({
'sales': [4, 2, 4, 16, 20, 8],
'signups': [7, 7, 8, 15, 17, 16],
'visits': [30, 52, 38, 72, 91, 60],
}, index=pd.date_range(start='2019/01/01', end='2019/07/01',
freq='M'))
ax = df.plot.area()
Area plots are stacked by default:
To produce an unstacked plot, pass stacked=False:
ax = df.plot.area(stacked=False)
Draw an area plot for a single column:
ax = df.plot.area(y='sales')
Draw with a different x:
df = pd.DataFrame({
'sales': [4, 2, 4],
'visits': [30, 52, 38],
'day': [1, 2, 3],
})
ax = df.plot.area(x='day')