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()