You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just an additional observation for the backend-experts: A custom patch without facecolor is rendered correctly. Additionally, an edgecolor is only necessary for png export, not for pdf.
Code
importmatplotlib.pyplotaspltfrommatplotlib.patchesimportPatchfig, ax=plt.subplots(figsize=(6, 3))
bar=ax.bar([1], height=4, hatch=".", label="auto")
patch_custom_1=Patch(label="custom - with fc", hatch=".", edgecolor="k")
patch_custom_2=Patch(label="custom - without fc", hatch=".", edgecolor="k", facecolor="None")
patch_custom_3=Patch(label="custom - without fc and ec", hatch=".", edgecolor="None", facecolor="None")
leg=plt.legend(handles=[bar, patch_custom_1, patch_custom_2, patch_custom_3], labelspacing=2, borderpad=1)
forpatchinleg.get_patches():
patch.set_height(20)
patch.set_y(-7)
plt.xlim([0, 5])
plt.savefig("demo.pdf")
fig, ax=plt.subplots(figsize=(6, 3))
bar=ax.bar([1], height=4, hatch=".", label="auto")
patch_custom_1=Patch(label="custom - with fc", hatch=".", edgecolor="k")
patch_custom_2=Patch(label="custom - without fc", hatch=".", edgecolor="k", facecolor="None")
patch_custom_3=Patch(label="custom - without fc and ec", hatch=".", edgecolor="None", facecolor="None")
leg=plt.legend(handles=[bar, patch_custom_1, patch_custom_2, patch_custom_3], labelspacing=2, borderpad=1)
forpatchinleg.get_patches():
patch.set_height(20)
patch.set_y(-7)
plt.xlim([0, 5])
plt.savefig("demo.png", dpi=300)
Bug summary
When drawing with hatches, dots show up in PDF as circles but they render fine as PNGs.
Code for reproduction
Actual outcome
PDF

demo.pdf
PDF converted as png
PNG

Expected outcome
The PNG and the PDF should look the same.
Additional information
No response
Operating system
macOS 12.3.1
Matplotlib Version
3.4.3
Matplotlib Backend
module://matplotlib_inline.backend_inline (inside jupyter notebook), PDF backend when generating PDF
Python version
Python 3.8.9
Jupyter version
6.4.0
Installation
pip
The text was updated successfully, but these errors were encountered: