I am preparing 3D plots and have found that the default axis labels are too
close to the tick labels, especially when large font sizes are chosen.  As
such, I would like to specify the position of the axis label.
Unfortunately, I haven't met much success.  See the code below (based on one
of the mplot3d examples).  Does anyone have any tips on how to move the axis
labels further away from the axis in 3D plots?

Thanks,
Justin

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
X, Y, Z = axes3d.get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=5, cstride=5)
ax.set_xlabel('x')

# This doesn't work:
ax.w_xaxis.set_label_coords(-0.2, -0.2)

# This doesn't work either:
# ax.w_xaxis.label.set_position((-0.2, -0.2))

# The axis label positions appear to have changed, but not in figure
print ax.w_xaxis.label.get_position()

plt.show()
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to