rootpy.plotting.contrib.plot_corrcoef_matrix

rootpy.plotting.contrib.plot_corrcoef_matrix(matrix, names=None, cmap=None, cmap_text=None, fontsize=12, grid=False, axes=None)[source]

This function will draw a lower-triangular correlation matrix

Parameters:

matrix : 2-dimensional numpy array/matrix

A correlation coefficient matrix

names : list of strings, optional (default=None)

List of the parameter names corresponding to the rows in matrix.

cmap : matplotlib color map, optional (default=None)

Color map used to color the matrix cells.

cmap_text : matplotlib color map, optional (default=None)

Color map used to color the cell value text. If None, then all values will be black.

fontsize : int, optional (default=12)

Font size of parameter name and correlation value text.

grid : bool, optional (default=False)

If True, then draw dashed grid lines around the matrix elements.

axes : matplotlib Axes instance, optional (default=None)

The axes to plot on. If None then use the global current axes.

Notes

NumPy and matplotlib are required

Examples

>>> matrix = corrcoef(data.T, weights=weights)
>>> plot_corrcoef_matrix(matrix, names)