labels in ax = Axes3D(fig) are not aligned in parallel

Hi,

I have seen this ever since I use mpl_toolkits.mplot3d.Axes3D but it never bothered me too much until now: the labels are not aligned in paralled to the axes so that with longer labels or small figsizes, they run into the tick labels, besides looking odd.

Attached is a screenshot. Is there anything I can do to change the angle manually?

Thanks in advance and best regards,
Daniel

3Dspiral.png

example_mpl3D_spiral.py (961 Bytes)

Daniel Mader, on 2011-01-24 20:55, wrote:

Hi,

I have seen this ever since I use mpl_toolkits.mplot3d.Axes3D but it never
bothered me too much until now: the labels are not aligned in paralled to
the axes so that with longer labels or small figsizes, they run into the
tick labels, besides looking odd.

Hi Daniel,

it does appear like a bug, though only for some views on the
axes, thanks for the report. I'm not very familiar with this
code, so I'll leave the bugfix for someone else, but here's the
temporary workaround:

Is there anything I can do to change the angle manually?

# prevent the automatic rotation caused by view changes
ax.yaxis.set_rotate_label(False)
ax.yaxis.label.set_rotation(45)

Beware that you'll have to adjust that angle on a per-view basis
to get things to look right.

best,

···

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

Dear Paul,

thank you very much for the quick reply! Unfortunately, I don’t seem to get things right with your snippet of code:

prevent the automatic rotation caused by view changes

ax.yaxis.set_rotate_label(False)

ax.yaxis.label.set_rotation(45)

Traceback (most recent call last):
File “example_mpl3D_spiral.py”, line 41, in
ax.yaxis.set_rotate_label(False)

AttributeError: ‘YAxis’ object has no attribute ‘set_rotate_label’

Am I missing something?

Thanks in advance,
best regards from a snowed up Salzburg,

Daniel

This problem with poorly rotated labels was fixed a couple of months
ago in the development branch and I believe it is also in 1.0.1. Just
to make sure, what version are you running?

Ben Root

···

On Monday, January 24, 2011, Daniel Mader <danielstefanmader@...982...> wrote:

Dear Paul,

thank you very much for the quick reply! Unfortunately, I don't seem to get things right with your snippet of code:

# prevent the automatic rotation caused by view changes
ax.yaxis.set_rotate_label(False)
ax.yaxis.label.set_rotation(45)
Traceback (most recent call last):
File "example_mpl3D_spiral.py", line 41, in <module>
ax.yaxis.set_rotate_label(False)
AttributeError: 'YAxis' object has no attribute 'set_rotate_label'

Am I missing something?

Thanks in advance,
best regards from a snowed up Salzburg,

Daniel