inequality.pen.pengram#

inequality.pen.pengram(gdf, col, name, figsize=(8, 6), k=5, scheme='quantiles', xticks=True, legend=True, leg_pos='lower right', fmt='{:.2f}', query=None, ax=None, inset_size='30%')[source]#

Pen’s Parade combined with a choropleth map.

This function generates a Pen’s Parade plot combined with a choropleth map. Both plots are placed within the same subplot, with the choropleth map as the main plot and the Pen’s Parade as an inset.

Parameters:
gdfgpd.GeoDataFrame

GeoDataFrame containing the data to plot.

colstr

The column to plot on the y-axis.

namestr

The name of the geographic units (e.g., states, regions).

figsizetuple, optional

The size of the figure as a tuple (width, height). Default is (8, 6).

kint, optional

Number of classes for the classification scheme. Default is 5.

schemestr, optional

Classification scheme to use (e.g., ‘Quantiles’). Default is ‘quantiles’.

xticksbool, optional

Whether to show x-axis ticks. Default is True.

legendbool, optional

Whether to show the map legend. Default is True.

leg_posstr, optional

The position of the legend on the choropleth map. Default is “lower right”.

fmtstr, optional

Format string for legend labels. Default is “{:.2f}”.

querylist, optional

Specific geographic units to highlight. Default is an empty list.

axmatplotlib.axes.Axes, optional

Matplotlib Axes instance to plot on. If None, a new figure and axes will be created. Default is None.

inset_sizestr, optional

Size of the inset plot as a percentage of the main plot. Default is “30%”.

Returns:
matplotlib.axes.Axes

Matplotlib Axes objects for the combined choropleth and Pen’s parade.