plot_polys()

Contents

plot_polys()#

liesel_gam.plot_polys(region, which, df, polys, show_unobserved=True, observed_color='none', unobserved_color='red')[source]#

Plot data on a map of regions defined by a dictionary of polygons.

Parameters:
  • region (str) – Name of the region column in the dataframe passed to df.

  • which (str | Sequence[str]) – Name of the column in the dataframe passed to df that should be used as the fill color for the plotted regions.

  • polys (Mapping[str, Array | ndarray | bool | number | bool | int | float | complex]) – Dictionary of arrays. The keys of the dict are the region labels. The corresponding values define the region by defining polygons. The neighborhood structure can be inferred from this polygon information.

  • show_unobserved (bool, default: True) – Only has an effect if df contains a column named "observed". If show_unobserved=True, or the column "observed" does not exist, then all regions will be plotted with color based on the column named in which. If show_unobserved=False, color filling will be applied only to the rows in df with observed=true.

  • observed_color (str, default: 'none') – Border color for observed regions.

  • unobserved_color (str, default: 'red') – Border color for unobserved regions.

Return type:

ggplot