8000 [Bug]: 3D bar chart appears over axis when using zlim · Issue #29482 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
[Bug]: 3D bar chart appears over axis when using zlim #29482
Open
@XrioBtw

Description

@XrioBtw

Bug summary

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.

Code for reproduction

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

Actual outcome

The actual outcome looks like this, where the bar charts render over the x and y axis:

actual-outcome

Expected outcome

Either left or right would be expected outcome:

expected-outcome

Additional information

No response

Operating system

Windows

Matplotlib Version

3.6.0

Matplotlib Backend

TkAgg

Python version

3.10.6

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0