plot_contacts#
- plot_contacts(pop, **kwargs)[source]#
Plot the age mixing matrix for a specific contact layer.
- Parameters:
pop (pop object) – population, either synthpops.pop.Pop or dict
**layer (str) – name of the physial contact layer: H for households, S for schools, W for workplaces, C for community or other
**aggregate_flag (bool) – If True, plot the contact matrix for aggregate age brackets, else single year age contact matrix.
**logcolors_flag (bool) – If True, plot heatmap in logscale
**density_or_frequency (str) – If ‘density’, then each contact counts for 1/(group size -1) of a person’s contact in a group, elif ‘frequency’ then count each contact. This means that more people in a group leads to higher rates of contact/exposure.
**state_location (string) – name of the state the location is in
**country_location (string) – name of the country the location is in
**cmap (str or Matplotlib cmap) – colormap
**fontsize (int) – base font size
**rotation (int) – rotation for x axis labels
**title_prefix (str) – optional title prefix for the figure
**fig (matplotlib.figure) – If supplied, use this figure instead of generating one
**ax (matplotlib.axes) – If supplied, use these axes instead of generating one
**do_show (bool) – If True, show the plot
**do_save (bool) – If True, save the plot to disk
- Returns:
Matplotlib figure.