pydiodon.plot_correlation_matrix¶
- pydiodon.plot_correlation_matrix(C, cmap='ocean', x11=True, plotfile=None, fmt='png')[source]¶
Plots a heatmap of the correlation matrix
- Parameters
- Ca 2D p x p numpy array
The correlation matrix to be plotted
- cmapa string
- the matplotlib colormap to usedefault value is “ocean”
- x11boolean
- whether to display the plot on the screendefault value is True
- plotfilestring
- the name of the file where to save the plotdefault value is None (plot not saved)
- fmta string
- the format of the file where the plot is savedpossible values are png, eps, pdf.
- Returns
Notes
For knowing all possible colormaps, see https://matplotlib.org/stable/tutorials/colors/colormaps.html
Example
>>> import pydiodon as dio >>> A, rn, cn = dio.load_dataset("diatoms_sweden") >>> C = dio.get_correlation_matrix(A) >>> dio.plot_correlation_matrix(C)
af, 22.10.27, revised 23.01.19