I am currently using the seaborn library in Python to create a facetted stacked barplot from a pandas dataframe named averages with columns ['Name', 'Period', 'Value', 'Solver'].
Here is the code I use to create the plot I want.
p = so.Plot(data = averages, x = 'Period', y = 'Value', color = 'Name').add(so.Bar(), so.Stack(), suptitle='Inventory levels')
p = p.facet(col='Solver', order=['spse', 'mp2', 'mels'])
I am searching for a way to add a general title to the plot i.e. a title above each subplot, like the function matplotlib.pyplot.suptitle function does for example.
I know that the function seaborn.objects.Plot.label has a title= option, but when I use it, this puts the same title above each subplot of the facetted graph.
You can provide an existing Matplotlib figure or axes for drawing the plot using
so.Plot.on. This gives you access to the underlyingmatplotlib.figure.Figureobject to which the suptitle can be added.