How to change the tick length of 3D plot in matplotlib

Viewed 241

A test code is in the following. When I add the length=10, the tick length does not change at all. Anyone can help?

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

fig = plt.figure()
ax = Axes3D(fig)

ax.scatter((0, 0, 1), (0, 1, 0), (1, 0, 0))
ax.w_xaxis.line.set_color('red')
ax.w_yaxis.line.set_color('red')
ax.w_zaxis.line.set_color('red')
ax.w_zaxis.line.set_color('red')
ax.xaxis.label.set_color('red')
ax.yaxis.label.set_color('red')
ax.zaxis.label.set_color('red')
ax.tick_params(axis='x', colors='red')   
ax.tick_params(axis='y', colors='red')  
ax.tick_params(axis='z', colors='red')  # add length = 10 does not change the length of ticks, why?

plt.show()
0 Answers
Related