From: John H. <jd...@gm...> - 2007-02-27 18:38:54
|
On 2/27/07, Sture Lygren <st...@ro...> wrote: > Thanks a lot for your reply. I still have some problem tough. I want > vertical alignment of 5 ylabels for 5 different subplots. Trying your > solution I'm able to move the ylabels up/down but not right/left. Seems > like changing 'x' in position (x,y) has no effect at all. How come? The ylabel position is layed out to not overlay the y tick labels -- if these are in different positions on each axes you will get the ylabel in different positions. Two solutions: 1) insure all the yticklabels have the same width by using a custom formatter that fixes the tick widths. from matplotlib.ticker import FormatStrFormatter ax.yaxis.set_major_formatter(FormatStrFormatter('%1.3f')) 2) do not use ylabels, but create your own using custom text instances for labels ax.text(-0.1, 0.5, 'my label', transform=ax.transAxes, rotation=90, ha='right', va='center') The 2nd one is probably what you want. JDH |