Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Centering line-broken axis label in matplotlib

Any idea why the ylabel isn't center justified and how I might go about centering it?

ylabel not centered in plot Rendering text with LaTeX (text.usetex: True)

ylabel('Soil Moisture Sensitivity,\n(0.01 K m$^3$ m$^{-3}$)')

Tried adding \centering, didn't work.

like image 444
jpatton Avatar asked Apr 13 '12 16:04

jpatton


1 Answers

did you try

ylabel('Soil Moisture Sensitivity,\n(0.01 K m$^3$ m$^{-3}$)', multialignment='center')?

As seen here: http://matplotlib.sourceforge.net/examples/pylab_examples/multiline.html

like image 90
craniumonempty Avatar answered Oct 05 '22 08:10

craniumonempty