0
votes

The idea is to plot a geoplot choropleth map with projection. However, as I added the parameter "projection=gcrs.AlbersEqualArea()", I got this error "'AxesSubplot' object has no attribute 'set_extent'". Hi, I was wondering if there is anyway to fix this error. Is it something related to package conflicts?

Thanks for your help!

    # Initialize the figure
    fig, ax = plt.subplots(1, 1, figsize=(16, 12))

    # Set up the color sheme:
    scheme = mc.Quantiles(fullData['A00100perN1'], k=10)

    # Map
    gplt.choropleth(fullData,
        hue="A00100perN1",
        linewidth=.0001,
        scheme=scheme, cmap='inferno_r',
        projection=gcrs.AlbersEqualArea(),
        legend=True,
        legend_kwargs={'loc': 'lower left'},
        edgecolor='white',
        legend_labels=['<40.5', '40.5-45.2', '45.2-48.8', '48.8-52.3', '52.3-55.9','55.9-60.4',\
                       '60.4-66.3','66.3-76.5','76.5-99.7','>99.7'],
        ax=ax)
    ax.set_title('Average adjusted gross income by ZIP code', fontsize=13)