Having trouble selecting 'male' and 'female' for hue when creating a cartogram with geoplot (using geopandas). I have only managed to select the total population but I would like to compare the state populations of male to female. I understand that the 'hue' assignment is probably what I need to modify but so far I can only display the total population (Tot_P_P) rather than both "Tot_P_M" and "Tot_P_F".
This is the code so far that works for total population. I've tried for the past 2 weeks looking through tutorials and websites but there isn't much info on cartograms.
working code for total population:
ax = gplt.polyplot(gda2020,
projection=gplt.crs.AlbersEqualArea(),
figsize = (25, 15)
)
gplt.cartogram(gda2020,
scale="Tot_P_P", limits=(0.2, 1), scale_func=None,
hue="Tot_P_P",
cmap='inferno',
norm=None,
scheme=None,
legend=True,
legend_values=None,
legend_labels=None,
legend_kwargs=None,
legend_var='hue',
extent=None,
ax=ax)