fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.tick_params(axis='x', direction='out', length=6, width=2, colors='r')
text3d(ax, (4, -2, 0), 'X-axis', zdir='z', size=0.5, usetex=False, ec=
    'none', fc='k')
text3d(ax, (12, 4, 0), 'Y-axis', zdir='z', size=0.5, usetex=False, angle=
    0.5 * 3.14159, ec='none', fc='k')
text3d(ax, (12, 10, 4), 'Z-axis', zdir='y', size=0.5, usetex=False, angle=
    0.5 * 3.14159, ec='none', fc='k')
ax.set_xlim3d(0, 10)
ax.set_ylim3d(0, 10)
ax.set_zlim3d(0, 10)
plt.show()
Настройка меток осей и ориентации имен для 3D-графиков в matplotlib