Python Forum

Full Version: Enhance my stacked barplot title, and flip legend
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've got most everything in order with my stacked barplot
[Image: Screenshot-95.png]
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