I'm drawing a simple 3D scatter plot using matplotlib; however, the Z axes label moves outside the bounding box. I tried adjusting the size, using tight.layout, and many more option, but I wasn't able to move the plot in such a way that the Z axes label is visible. Here is my code:
fig = plt.figure(figsize = (7,7), dpi = 200)
ax = fig.add_subplot(projection='3d')
xs = df_final_depth['Power']
ys = df_final_depth['Velocity']
z = df_final_depth['Predicted Depth (um)']
zs = df_final_depth['Ground Truth Depth (um)']
ax.scatter(xs, ys, z, s=70, label="Predicted Depth ($\mu$$m$)", marker='o')
ax.scatter(xs, ys, zs, label="Ground Truth Depth ($\mu$$m$)", marker='^')
ax.set_xlabel("Power ($W$)")
ax.set_ylabel("Scanning Velocity ($mm/s$)",)
ax.set_zlabel("Depth ($\mu$$m$)")
#ax.tick_params()
ax.legend()
plt.show()
Please refer to the attached pictures. Tried tight.layout, changing the figure size and many other options. Can someone advise on solving this issue?