geomappy.plotting.shapes.plot_shapes

geomappy.plotting.shapes.plot_shapes(df: GeoDataFrame | GeoSeries | None = None, lat: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None = None, lon: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None = None, values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | float | None = None, s: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | float | None = None, bins: tuple[float] | None = None, cmap: Colormap | None = None, nan_color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | None = None, norm: Normalize | None = None, vmin: float | None = None, vmax: float | None = None, extend: Literal['neither', 'both', 'min', 'max'] | None = None, legend: str | LegendCreator | None = 'colorbar', ax: Axes | None = None, legend_ax: Axes | None = None, linewidth: float = 1, **kwargs) tuple[list[Collection], Colorbar | Legend | None]

Plot shapes with continuous numeric values (scalar choropleth).

Parameters:
  • df (GeoDataFrame or GeoSeries, optional) – DataFrame or Series containing the geometries. If None, lat and lon must be provided.

  • lat (array_like, optional) – Latitude and longitude values if df is not provided.

  • lon (array_like, optional) – Latitude and longitude values if df is not provided.

  • values (array_like, numeric, or str, optional) – Values to map to colors. Can be broadcast if scalar. If df is provided and values is a string, it will be interpreted as a column name.

  • s (array_like, numeric, or str, optional) – Marker sizes, broadcast if scalar. Strings are interpreted as column names in df.

  • bins (array_like, optional) – Bins for discretizing the values using a BoundaryNorm. Overrides vmin and vmax.

  • cmap (Colormap or str, optional) – Colormap for the scalar values.

  • nan_color (ColorType, optional) – Color for NaN values.

  • norm (Normalize, optional) – Normalizer for scalar values. Not compatible with bins.

  • vmin (float, optional) – Limits for color mapping. Ignored if bins or norm are provided.

  • vmax (float, optional) – Limits for color mapping. Ignored if bins or norm are provided.

  • extend ({'neither', 'min', 'max', 'both'}, optional) – Extend of the colorbar. Determined automatically if None.

  • legend ({‘colorbar’, ‘legend’, None} or LegendCreator, optional) – Type of legend to display.

  • ax (Axes, optional) – Axes to plot on. Created if None.

  • legend_ax (Axes, optional) – Axes for the legend. Created if None.

  • linewidth (float, optional) – Line width of geometry borders.

  • **kwargs – Additional keyword arguments for _plot_geometries, including facecolor and edgecolor.

Returns:

Notes

When using a GeoAxes, provide extent if data and axes do not perfectly overlap. If the plotting projection differs from the data, provide transform.