Skip to content

Hatching doesn't respect alpha #7992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
japborst opened this issue Jan 30, 2017 · 8 comments
Closed

Hatching doesn't respect alpha #7992

japborst opened this issue Jan 30, 2017 · 8 comments
Milestone

Comments

@japborst
Copy link

Bug report

Bug summary
When plotting using a hatch, alpha is not applied to the hatching

Code for reproduction

import matplotlib.pyplot as plt
plt.fill_between(range(10), [10]*10, hatch='/', alpha=0.5)
plt.show()

Actual outcome
Hatching is black with no alpha
Example

Expected outcome
Before matplotlib 2.0, the hatching was the color of the fill and alpha was respected

Matplotlib version

Windows 7
matplotlib 2.0.0
numpy 1.12.0
scipy 0.18.1
Installation through pip

@dstansby
Copy link
Member

It looks like this will be fixed by #7976, in the case where the edgecolor argument is specified to fill_between to choose the colour of the hatch.

@dstansby dstansby added this to the 2.0.1 (next bug fix release) milestone Jan 30, 2017
@japborst
Copy link
Author

Nice! Thanks for the quick update :)

@dstansby
Copy link
Member

This is now fixed in master and 2.0.1

@kilojoules
Copy link

Is there no way to control the hatch transparency separately?

@tacaswell
Copy link
Member

At the lowest level it can be controlled, but currently there is no user interface to this in the classes we ship. If you need a different color hatch + edge, I suggest using two over-lapping artists.

@ghost
Copy link

ghost commented Apr 28, 2018

Is there any update about separate transparency control? If I use two artists to get desired effect, I have problem with legend.

@tacaswell
Copy link
Member

@usiu5555 See the last example of https://matplotlib.org/users/legend_guide.html#legend-handlers that section for how to handle merging multiple artists into a single legend entry.

There has not bee any progress on threading the alpha control of the hatch through the Artist classes, would you be interested in looking into that @usiu5555 ?

@ghost
Copy link

ghost commented Apr 30, 2018

@tacaswell Thank you, that helped, and was much easier than I expected.

Well, sounds like a challenge, but sadly, because of many reasons, I can't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants