I am trying add hatching over specific polygons that represent counties in a state in the US. Each polygon is filled in correlation to the amount of grocery stores that are in that specific county. The hatching would represent 5 levels (range of highest to lowest) of diabetes rates for adults for each of the counties.
I've come across various possible ways of implementing this but each time I come away kind of stumped.
-I have seen a post on here where someone used the Descartes
package to draw an individual polygon, but like other posts I've seen regarding this, I'm not sure if I have to use GeoJSON
coordinates for the polygon? I attained coordinates for each polygon through my pyshp package, are these the right coordinates to use? I feel like they are not..
Descartes
example: https://gis.stackexchange.com/questions/197945/geopandas-polygon-to-matplotlib-patches-polygon-conversion
example of the coordinates from pyshp
package:
from area import area
sf = shapefile.Reader("county_az.shp")
Shapes = sf.shapes()
bbox = Shapes[3].bbox
#1
[-12296461.118197802, 3675955.2075050175, -12139158.....]
#2
[-12618534.046562605, 4063552.9669038206, -12328686.313377801, ....]
#3
[-12436701.142463798, 3893144.9847336784, -12245216.013980595, ...]
-When I come across contour plots, my problem is that it is intended for the entire plot, I cannot limit the lat and long range for a specific polygon because there are not enough values. I believe I have the same issue with clipping as well.
As seen here:Hatch area using pcolormesh in Basemap
I should note that my data for my plot is a shapefile, and I have columns regarding Diabetes rates for adults for 2010, grocery stores per county as well as other variables.
Is there a way to hatch over individual polygons on a basemap
?