I'm not looking for an alternative. I just want to make below code work, because it's a lot simple than otehr solutions.
I want to perform a groupby (A ,B), then scatter plot the relationship for C and D. I want each group is plotted in a subplot. I checked the docs: http://pandas.pydata.org/pandas-docs/version/0.16.2/generated/pandas.core.groupby.DataFrameGroupBy.plot.html It seems to be able to do this in one line. However, the code below plot each group seperately in a new chart.
test = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar',
'foo', 'bar', 'foo', 'foo'],
'B': ['one', 'one', 'two', 'three',
'two', 'two', 'one', 'three'],
'C': np.random.randn(8),
'D': np.random.randn(8)})
test.groupby(['A', 'B']).plot(kind='scatter', x='C', y='D', subplots=True)
plt.show()