最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - matplotlib - 3D bar chart appears over axis when using zlim - Stack Overflow

programmeradmin4浏览0评论

When I make a 3D bar chart with Matplotlib and change the z axis limits using ax.set_zlim(newMin, newMax) the part of the bar charts below the new z axis minimum value appears above the x and y axis. I would like to ensure that the x and y axis always renders at the top, but I don't know how to achieve this. I tried ax.set_zorder(bigNumber) and ax.xaxis.set_zorder(bigNumber), but it didn't change anything.

Example to reproduce problem:

fig, ax = plt.subplots(subplot_kw = {"projection" : "3d"})
ax.bar3d([1, 1, 2, 2], [1, 2, 1, 2], 0, 1, 1, [2, 3, 1, 4])
ax.set_zlim(2, 4)
ax.set_zorder(10000000) # does not help
plt.show()

发布评论

评论列表(0)

  1. 暂无评论