-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Open
Labels
Description
Bug summary
When plotting Poly3DCollection
with axlim_clip=True
, the patch is split into multiple patches and renders poorly.
I am leaning towards this being the "correct" behavior, but want to open the bug report to document it and see if anyone has a solution that solves this cleanly.
Code for reproduction
import numpy as np
import matplotlib.pyplot as plt
# Generate some random data
np.random.seed(42)
x = np.arange(10)
y = np.zeros_like(x)
z = np.random.randint(5, 10, 10)
fig, ax = plt.subplots(1, 1, subplot_kw={'projection': '3d'})
ax.fill_between(x, y, z, x, 0, 0, axlim_clip=True)
ax.set_xlim(0, 8)
plt.show()
Actual outcome
Expected outcome
Additional information
There are two workarounds for this particular example:
- Restrict the data to the x=[0, 8] range before plotting.
- Use
fill_between
with thequad
mode like so:
ax.fill_between(x, y, z, x, 0, 0, axlim_clip=True, mode='quad', shade=False)
Matplotlib Version
3.10.0
Installation
git checkout