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:
- data
pd.DataFrame A square DataFrame, representing a covariance matrix. The index and the columns should both have the same values.
- vars_to_plot
listofstr, 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.
- cbarlabel
str, optional The label for the colorbar.
- figsize
tupleoffloat, optional The size of the figure to create, in inches.
- dpi
int, optional The dots per inch of the figure.
- cbar_kw
dict, optional A dictionary of keyword arguments to pass to the colorbar.
- cmap
str, optional The color map to use for the heatmap.
- heatmap_kwargs
dict, optional Keyword arguments forwarded to plt.imshow
- annotation_kwargs: dict, optional
Keyword arguments forwarded to gEconpy.plotting.annotate_heatmap
- data
- Returns:
matplotlib.figure.FigureA figure containing the heatmap.