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:
- gdf
gpd.GeoDataFrame
GeoDataFrame containing the data to plot.
- col
str
The column to plot on the y-axis.
- name
str
The name of the geographic units (e.g., states, regions).
- figsize
tuple
,optional
The size of the figure as a tuple (width, height). Default is (8, 6).
- k
int
,optional
Number of classes for the classification scheme. Default is 5.
- scheme
str
,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_pos
str
,optional
The position of the legend on the choropleth map. Default is “lower right”.
- fmt
str
,optional
Format string for legend labels. Default is “{:.2f}”.
- query
list
,optional
Specific geographic units to highlight. Default is an empty list.
- ax
matplotlib.axes.Axes
,optional
Matplotlib Axes instance to plot on. If None, a new figure and axes will be created. Default is None.
- inset_size
str
,optional
Size of the inset plot as a percentage of the main plot. Default is “30%”.
- gdf
- Returns:
matplotlib.axes.Axes
Matplotlib Axes objects for the combined choropleth and Pen’s parade.