plot_quadrant_map
site.SiteProblem.plot_quadrant_map(
hotspots_df=None,
what='demand_equity',
n_bins=3,
ax=None,
interactive=False,
combination_method='multiply',
neighbourhood_method='rook',
k=None,
verbose=True,
significance_threshold=0.05,
force_weight_recalculation=False,
priority_colour='#d7191c',
concerning_colour='#fdae61',
positive_colour='#2c7bb6',
neutral_colour='#bdbdbd',
significant_edgecolor='#1a1a1a',
significant_linewidth=1.8,
non_significant_edgecolor='#bbbbbb',
non_significant_linewidth=0.4,
tiles='CartoDB positron',
show_basemap=True,
show_axis=False,
opacity=0.7,
legend_loc='outside',
legend_bbox_to_anchor=None,
figsize=None,
**kwargs,
)Plot the 2×2 attribute typology for a combined demand/deprivation analysis.
Each area is coloured according to whether it is high or low on demand and deprivation independently (the attribute_typology column produced by :meth:get_hotspots with what="demand_equity"). Areas that are also statistically significant spatial clusters (Hotspot or Coldspot) are additionally highlighted with a bolder border.
This plot complements :meth:plot_hotspots: where that method shows spatial clustering, this one shows the underlying attribute structure — i.e. why an area is (or is not) a hotspot.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| hotspots_df | geopandas.GeoDataFrame | Pre-computed results from :meth:get_hotspots with what="demand_equity". If None, the analysis is run automatically using the supplied parameters. |
None |
| n_bins | int | Number of quantiles to split the typologies into (2 for halves, 3 for thirds). | 3 |
| ax | matplotlib.axes.Axes | Axes to plot on. A new figure and axes are created if not provided. Ignored when interactive=True. |
None |
| interactive | bool | If True, returns an interactive Folium map. Otherwise returns a static matplotlib axes. |
False |
| combination_method | (multiply, sum, rank) | Score combination method passed to :meth:get_hotspots when hotspots_df is None. |
"multiply" |
| neighbourhood_method | (rook, queen, k - nearest) | Spatial weights method passed to :meth:get_hotspots when hotspots_df is None. |
"rook" |
| k | int | Number of neighbours for neighbourhood_method="k-nearest". |
None |
| verbose | bool | Whether to print progress when recomputing hotspots. | True |
| significance_threshold | float | P-value threshold used to determine which areas receive a bold significance border. | 0.05 |
| force_weight_recalculation | bool | If True, spatial weights are recalculated even if cached. |
False |
| priority_colour | str | Colour for High Demand / High Deprivation areas. | "#d7191c" |
| concerning_colour | str | Colour for High Demand / Low Deprivation areas. | "#fee08b" |
| positive_colour | str | Colour for Low Demand / High Deprivation areas. | "#abd9e9" |
| neutral_colour | str | Colour for Low Demand / Low Deprivation areas. | "#bdbdbd" |
| significant_edgecolor | str | Border colour for statistically significant spatial clusters. | "#1a1a1a" |
| significant_linewidth | float | Border width for statistically significant spatial clusters. | 1.8 |
| non_significant_edgecolor | str | Border colour for non-significant areas. | "#bbbbbb" |
| non_significant_linewidth | float | Border width for non-significant areas. | 0.4 |
| tiles | str | Tile provider for interactive maps. | "CartoDB positron" |
| show_basemap | bool | Whether to add a basemap (static) or tile layer (interactive). | True |
| show_axis | bool | Whether to show axis ticks and labels on static plots. | False |
| opacity | float | Fill opacity for all areas. | 0.7 |
| figsize | tuple | None | Allow overriding size of static plot | None |
| **kwargs | Additional keyword arguments passed to GeoDataFrame.plot or GeoDataFrame.explore. |
{} |
Returns
| Name | Type | Description |
|---|---|---|
| matplotlib.axes.Axes or folium.Map |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If hotspots_df is provided but does not contain an attribute_typology column, suggesting it was not produced by a combined analysis. |