I have a problem with shifting the label of z axis in z direction (along the axis) in 3d plot. I want to have the label of Z-axis at its end. I found that it should be possible for example by ax.zaxis.set_label_coords(0,0,10)
but it does not work.
I am using the following code to generate the plot:
from mpl_toolkits.mplot3d import Axes3D
%matplotlib notebook
fig = plt.figure(figsize=(10,7))
ax = fig.gca(projection='3d')
ax.xaxis.set_rotate_label(False)
ax.set_xlabel(r'$X$',fontsize=16,rotation=0)
ax.set_xlim3d(0, 9)
ax.yaxis.set_rotate_label(False)
ax.set_ylabel(r'$Y$',fontsize=16,rotation=0)
ax.set_ylim3d(0.35, 0.58)
ax.zaxis.set_rotate_label(False)
ax.set_zlabel(r'$Z$',fontsize=16,rotation=0, labelpad=5)
ax.zaxis.set_label_coords(0,0,10)
ax.set_zlim3d(0, 10)
ax.view_init(elev=30., azim=220)
plt.show()