geoplot.
polyplot
(df, projection=None, extent=None, figsize=(8, 6), ax=None, edgecolor='black', facecolor='None', **kwargs)¶Trivially plots whatever geometries are passed to it. Mostly meant to be used in concert with other, more interesting plot types.
Parameters: |
|
---|---|
Returns: | The axis object with the plot on it. |
Return type: | AxesSubplot or GeoAxesSubplot instance |
Examples
A trivial example can be created with just a geometry and, optionally, a projection.
import geoplot as gplt
import geoplot.crs as gcrs
gplt.polyplot(boroughs, projection=gcrs.AlbersEqualArea())
However, note that polyplot
is mainly intended to be used in concert with other plot types.
ax = gplt.polyplot(boroughs, projection=gcrs.AlbersEqualArea())
gplt.pointplot(collisions[collisions['BOROUGH'].notnull()], projection=gcrs.AlbersEqualArea(),
hue='BOROUGH', categorical=True,
legend=True, edgecolor='white', linewidth=0.5, legend_kwargs={'loc': 'upper left'},
ax=ax)
Additional keyword arguments are passed to the underlying matplotlib.patches.Polygon
instances (ref).
ax = gplt.polyplot(boroughs, projection=gcrs.AlbersEqualArea(),
linewidth=0, facecolor='lightgray')