I need to create a LISA map for my work, and I am having problem when I'm trying to plot using geopandas.

My data sources are: map_df # A Dataframe Structure of the dataframe

A geopandas series :

hh = map_df.loc[(map_df['quadrant']==1) & (map_df['significant']==True), 'geometry']

When I try to create a map using

for line in hh:

    gpd.plotting.plot_polygon_collection(ax, line, color='red', linewidth=5)

I'm getting the following error: Error

I tried all options from this page gpd.plotting, but nothing worked.

Can you see the error that is happening here?

  • plot_polygon_collection is meant to be called with a collection of polygons (eg GeoSeries or array of them), not with a single polygon. But actually, it is also not recommended to call this directly: it's easier to use the plot method of the GeoSeries or GeoDataFrame. – joris May 13 '19 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.