pydiodon.plot_components_heatmap¶
- pydiodon.plot_components_heatmap(Y, axis_1=1, axis_2=2, bins=256, cmap='ocean', range=None, log=True, scale=False, title=None, x11=True, imfile=None, fmt='png')[source]¶
Builds the density heatmap of the point cloud of the components of a PCA
- Parameters
- Ya \(n \times k\) 2D numpy array
array of the components
- binsan integer
the size of the image, in pixels
- axis_1an integer
- first axis to be plottedcolumns in the image
- axis_2an integer
- second axis of Yrows in the image
- binsan integer
- the size of the imageit is also the number of classes per axis in the 2D histogram
- cmapa string
- the matplotlib colormap for the heatmapdefault value is oceanclassical default value in matplotlib is viridissee https://matplotlib.org/stable/tutorials/colors/colormaps.html for a choice
- rangeis None
compulsory for callind 2D histogram
- loga boolean
- whether to translate the densities in a logarithmic scaledefault value is True
- scalea boolean
- deprecateddefault value is False
- titlea string
- the title of the heatmapdefault value is None (no title)
- x11a boolean
- whether to display the plot on the screendefault value is True (plot displayed)
- plotfilea string
- the name of the file where to save the plotdefault value is None (plot not saved)
- fmta string
- format of the file where the plot is savedpossible values are : png, eps, pdfdefault value is png
- Returns
- a heatmap
Notes
Y is a numpy array of coordinates, as produced by the MDS
when two axis are selected
the two components are extracted
a 2D histogram of their values is computed with a call to np.histogram2d()
the heatmap is drawn with the values of the 2D histogram
af, 25/01/2020, revised 22.10.36