Consider the following sample data frame:
rng = pd.date_range('1/1/2011', periods=72, freq='H')
df = pd.DataFrame({
'cat': list('ABCD'*int(len(rng)/4)),
'D1': np.random.randn(72),
'D2': np.random.randn(72),
'D3': np.random.randn(72),
'D4': np.random.randn(72)
}, index=rng)
I'm looking for an idiomatic way to scatter-plot this as following:
- 4 subplots (tiles), one for each category
(A, B, C, or D)
- each D series plotted in its own color
I can do this with a bunch of filtering and for-loops, but I'm looking for a more compact pandas-like way.