Skip to content
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

Add SPC hatch effect for PlotGeometry #2086

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nawendt
Copy link
Contributor

@nawendt nawendt commented Sep 8, 2021

Add hatching effect to mimic hatching used for SPC probabilistic severe weather outlooks. Testing and an example were also added.

Matplotlib complains about the fact this is a custom hatch that uses a custom string to invoke its use. It will have to be dealt with somehow as that will eventually cause and error in future versions of matplotlib.

Add hatching effect to mimic hatching used for SPC probabilistic severe
weather outlooks. Testing and an example were also added.

Closes Unidata#2063
@nawendt nawendt requested review from kgoebber and a team as code owners September 8, 2021 03:43
Eliminate geopandas import issues by just creating a shapely.Polygon
@@ -498,6 +500,23 @@ def lookup_map_feature(feature_name):
return feat.with_scale(scaler)


@exporter.export
class SPCHatch(matplotlib.hatch.Shapes):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we wait on the custom hatch? Matplotlib has deprecated passing in hatch values it doesn't understand in 3.4, with plans to remove it in 3.6. Thus using this would result in an error trying to use this when matplotlib 3.6 comes out. matplotlib/matplotlib#20690 is discussing having a proper API for adding custom hatches, so it would be good for you to weigh in there (maybe with the example of what yours looks like). You could also push that forward with a draft API if you're feeling particularly driven. 😉

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

Successfully merging this pull request may close these issues.

Add hatching to PlotGeometry
2 participants