Skip to content

Hatching doesn't respect alpha #7992

Closed
Closed

Description

@japborst

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

Activity

  1. dstansby commented on Jan 30, 2017

    @dstansby
    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.

  2. added this to the milestone on Jan 30, 2017
  3. japborst commented on Jan 30, 2017

    @japborst
    Author

    Nice! Thanks for the quick update :)

  4. dstansby commented on Feb 20, 2017

    @dstansby
    Member

    This is now fixed in master and 2.0.1

  5. kilojoules commented on Jun 25, 2017

    @kilojoules

    Is there no way to control the hatch transparency separately?

  6. tacaswell commented on Jun 25, 2017

    @tacaswell
    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.

  7. tacaswell commented on Apr 29, 2018

    @tacaswell
    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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions