gEconpy.plotting.plot_covariance_matrix#

gEconpy.plotting.plot_covariance_matrix(data, vars_to_plot=None, cbarlabel='Covariance', figsize=(4, 4), dpi=100, cbar_kw=None, cmap='YlGn', heatmap_kwargs=None, annotation_kwargs=None)#

Plot a heatmap of the covariance matrix of the input data.

Parameters:
datapd.DataFrame

A square DataFrame, representing a covariance matrix. The index and the columns should both have the same values.

vars_to_plotlist of str, optional

A list of strings containing the names of the variables to plot. If not provided, all variables in the input data will be plotted.

cbarlabelstr, optional

The label for the colorbar.

figsizetuple of float, optional

The size of the figure to create, in inches.

dpiint, optional

The dots per inch of the figure.

cbar_kwdict, optional

A dictionary of keyword arguments to pass to the colorbar.

cmapstr, optional

The color map to use for the heatmap.

heatmap_kwargsdict, optional

Keyword arguments forwarded to plt.imshow

annotation_kwargs: dict, optional

Keyword arguments forwarded to gEconpy.plotting.annotate_heatmap

Returns:
matplotlib.figure.Figure

A figure containing the heatmap.