Thursday, February 23, 2012

Removing tick-labels from an axis in Matplotlib

If you want a make a 3D plot for which you don't want any text on the axis-ticks,
the following should do that (pl = pylab):


fig = pl.figure(1, figsize=(4, 3))
pl.clf()
ax = Axes3D(fig, elev=43.5, azim=-110)
....
....
ax.set_xlabel('X_1')
ax.set_ylabel('X_2')
ax.set_zlabel('Y')
ax.w_xaxis.set_ticklabels([])
ax.w_yaxis.set_ticklabels([])
ax.w_zaxis.set_ticklabels([])

An example plot:



for python with pylab, matplotlib & Axes3D

No comments:

Post a Comment