Turn off z-axis only in 3-d plot

一笑奈何 提交于 2019-12-05 18:47:19

问题


I have some mpl_toolkits.mplot3d surface plots that I am viewing from different angles. When viewed from directly above (elev = 90, azim = 90) the text of the z-axis is all piled up on top of itself.

ax.set_axis_off() hides all of the axes, but I want to hide or turn off the z-axis but still see the x and y axes.

How can I do it?


回答1:


Most of the features are accessible via w_zaxis:

In this case you can use:

ax.w_zaxis.line.set_lw(0.)
ax.set_zticks([])



回答2:


Though this question was posted a long time ago, I did not find a good solution for this. I tried it myself then found this code below might work:

ax.set_zticks([])


来源:https://stackoverflow.com/questions/12391271/turn-off-z-axis-only-in-3-d-plot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!