Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: 3D bar chart unexpected behavior when using axlim_clip and set_zlim #30524

@LangQi99

Description

@LangQi99

Bug summary

3D bar chart unexpected behavior when using axlim_clip

When I want to use axlim_clip to fix #29482, I find its unexpected behavior.

Clip the data to the axes view limits: https://matplotlib.org/stable/gallery/mplot3d/axlim_clip.html

Code for reproduction

import matplotlib.pyplot as plt
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], axlim_clip=True)
ax.set_zlim(2, 4)
plt.show()

Actual outcome

Image

Expected outcome

Image

from #29482

Additional information

No response

Operating system

OS/X

Matplotlib Version

3.11.0.dev1302+g4c817b820

Matplotlib Backend

macosx

Python version

3.12.11

Jupyter version

No response

Installation

git checkout

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