-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Open
Labels
Description
Bug summary
Compare Issue #15491.
The pgf backend fails to render hatching properly (sometimes absent, sometimes partial) when the axes limits are set. Exact conditions depend on dataset and limits chosen. Hatching is rendered correctly in QtAgg backend.
Code for reproduction
import numpy as np
import matplotlib as mpl
mpl.use('pgf')
import matplotlib.pyplot as plt
x = y = np.arange(10)
plt.plot(x,y)
plt.fill_between(x,y,
facecolor="none", hatch="X",
linewidth=0)
plt.xlim(0,8)
plt.savefig('testPlot.png')
Actual outcome
Expected outcome
Additional information
In the test case, when no limit is set, hatch is rendered correctly.
When limits are set, the following work as expected:
plt.xlim(0,9) ... plt.xlim(8,9)
But these limit cause hatch to be unrendered
plt.xlim(0,1) ... plt.xlim(0,8)
the exact parameters likely depend on data being plotted. On a live dataset that I was using, the hatch was partially rendered in some of the expected area but cut off elsewhere (not at the limits set)
Operating system
WSL2
Matplotlib Version
3.8.4
Matplotlib Backend
pgf
Python version
3.12.2
Jupyter version
No response
Installation
conda