0

Hopefully an easy question, I'm trying to plot a hierarchical dataframe into separate plots per hierarchy. I've grouped by the hierarchies and want to plot the data via setting the X and Y axis corresponding to the relevant columns, however I'm not sure how to set the plot title equal to the hierarchy name of that group?

for example if the hierarchy names were a, b, c the 3 plots should have titles a, b, c.

dfplot.groupby(level=0, sort=False).plot(x='Date', y='Adj Close', 
figsize=(16, 6));
  • Did you read [this](https://stackoverflow.com/questions/16376159/plotting-a-pandas-dataseries-groupby) and [this](https://stackoverflow.com/questions/25239933/how-to-add-title-to-subplots-in-matplotlib) – Sheldore Jul 12 '19 at 10:32
  • Possible duplicate of [Matplotlib - global legend and title aside subplots](https://stackoverflow.com/questions/7526625/matplotlib-global-legend-and-title-aside-subplots) – Sheldore Jul 12 '19 at 10:34
  • not sure those answer my question as they either manually set the title or refer to one title for all subplots, I need to have the subplot titles equal correspond to the hierarchy index which is unique per subplot – Novice Python charmer Jul 12 '19 at 11:06
  • Where are the hierarchy names in your code? – ImportanceOfBeingErnest Jul 12 '19 at 11:34

0 Answers0