Skip to content

Adding hatches changes face color #14639

Closed as not planned
Closed as not planned
@SMZ70

Description

@SMZ70

Bug report

Bug summary

Adding hatches results in a change in the face color of bars. The problem occurs when saved as PDF. Everything is ok with png.

Code for reproduction

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.barh(2, 4, edgecolor='black', facecolor='green', alpha=0.3)
ax.barh(3, 4, edgecolor='black', facecolor='green', hatch='///', alpha=0.3)
fig.savefig('hbarplot.pdf')
fig.savefig('hbarplot.png')

Actual outcome

image

Expected outcome

The plot in the pdf file to be the same as the one in png file.

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 3.0.3, conda, default
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg or module://ipykernel.pylab.backend_inline (problem occurs with both)
  • Python version: 3.7

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