| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…llection. PatchCollection will currently ignore hatches of the provided patches, only allowing a hatch passed as a keyword into the constructor. If match_original is true, we now keep the hatch of the first patch provided in the collection. Additionally, the hatchcolor is determined by the edge color, so we will only pass the edgecolors of the patches to the Collection if the edgecolor is not blank - its default color of [0, 0, 0, 0]. This ensures that the hatch will use its default of black in the case where no edgecolor of the patches was ever set.
…r a PatchCollection when match_original is true.
There was a problem hiding this comment.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Sorry, something went wrong.
| kwargs['linestyles'] = [p.get_linestyle() for p in patches] | ||
| kwargs['antialiaseds'] = [p.get_antialiased() for p in patches] | ||
| if patches: | ||
| kwargs['hatch'] = patches[0].get_hatch() |
There was a problem hiding this comment.
If we are going to only pick of the hatch from the first patch, then we should warn or raise if we are going to ignore the rest of the hatches.
Sorry, something went wrong.
There was a problem hiding this comment.
Why? If that's true, it would be impossible to make a collection of multiple patches w/ hatches without getting a warning.
Sorry, something went wrong.
There was a problem hiding this comment.
sorry I was not clear. The check should be "are all of the hatches the same? if so carry on, if not fail!" As implemented if the user passes in
[
mpatches.Rectangle((0, 0), 0.2, .2, hatch="/"),
mpatches.Rectangle((0.4, 0.4), 0.2, .2, hatch="\\")
]then the first hatch will be used for both and we will silently drop the "\\" on the second one!
Sorry, something went wrong.
| return patch.get_facecolor() | ||
| return [0, 0, 0, 0] | ||
|
|
||
| def is_default(c): |
There was a problem hiding this comment.
This in only the default default (that is, there is a set of rcparams which will cause this to be miss. Looking at
matplotlib/lib/matplotlib/patches.py
Lines 315 to 339 in c19cd34
Sorry, something went wrong.
|
Thank you for working on this @hhalwan and apologies for the delay in getting this reviewed. Do my comments make sense? |
Sorry, something went wrong.
…h._original_edgecolor to see if edgecolors were set.
| hatch = patches[0].get_hatch() | ||
| kwargs['hatch'] = hatch | ||
| if any(p.get_hatch() != hatch for p in patches): | ||
| warnings.warn("More than one type of hatch detected in " |
There was a problem hiding this comment.
Should use _api.warn_external? Also should be tested.
Sorry, something went wrong.
|
@hhalwan do you plan to come back to this? |
Sorry, something went wrong.
|
@timhoffm I don't have time right now, I'm happy to let someone else take it up. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Fixes this issue. PatchCollection currently ignores the hatches of the provided patches, only allowing a hatch passed as a keyword into the constructor. If match_original is true, we now keep the hatch of the first patch provided in the collection, rather than using the hatch passed as a keyword into the constructor. Edited the doc strings to reflect this. Additionally, the hatchcolor is determined by the edge color, so we will only initialize the collection with the edgecolors of the patches if the edgecolor is not blank - its default color of [0, 0, 0, 0]. This ensures that the hatch will use its default of black in the case where no edgecolor of the patches is ever set.
PR Checklist
Tests and Styling
Documentation