How can I add a newline to a plot\'s label (e.g. xlabel or ylabel) in matplotlib? For example,
plt.bar([1, 2], [4, 5]) plt.xlabel(\"My x label\") plt.ylabel
plt.bar([1, 2], [4, 5]) plt.xlabel("My x label") plt.ylabel(r"My long label with $\Sigma_{C}$ math" + "\n" + "continues here")
Just concatenate the strings with a newline that isn't in raw string form.