Python Forum
Enhance my stacked barplot title, and flip legend - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: Data Science (https://python-forum.io/Forum-Data-Science)
+--- Thread: Enhance my stacked barplot title, and flip legend (/Thread-Enhance-my-stacked-barplot-title-and-flip-legend)



Enhance my stacked barplot title, and flip legend - Clunk_Head - Jul-08-2019

I've got most everything in order with my stacked barplot
─░mage

but I am missing two things:
1) Can I have multiple title lines, each to which I can apply different text properties?
plt.title("Title line 1",fontsize=20)
#One of them will be bold
#Two of them will be one color and the third another color
#Two will be center aligned and the third left aligned
2) Can I flip the legend upside down?
plt.legend(names[1:])
I've tried:
plt.legend(names[1:], handles[::-1], labels[::-1])
but it gives me an error:
Error:
plt.legend(names[1:], handles[::-1], labels[::-1]) NameError: name 'handles' is not defined