Create a grid of correlation plots.
The individual correlation plots are assumed to all have the same variables, axis labels can be specified only once.
Parameters: | dcorrs : list or iterable of ndarrays
titles : list of str, optional
ncols : int, optional
normcolor : bool or tuple, optional
xnames : list of str, optional
ynames : list of str, optional
fig : Matplotlib figure instance, optional
cmap : str or Matplotlib Colormap instance, optional
|
---|---|
Returns: | fig : Matplotlib figure instance
|
Examples
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> import statsmodels.api as sm
In this example we just reuse the same correlation matrix several times. Of course in reality one would show a different correlation (measuring a another type of correlation, for example Pearson (linear) and Spearman, Kendall (nonlinear) correlations) for the same variables.
>>> hie_data = sm.datasets.randhie.load_pandas()
>>> corr_matrix = np.corrcoef(hie_data.data.T)
>>> sm.graphics.plot_corr_grid([corr_matrix] * 8, xnames=hie_data.names)
>>> plt.show()