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 plotted
columns in the image
axis_2an integer
second axis of Y
rows in the image
binsan integer
the size of the image
it is also the number of classes per axis in the 2D histogram
cmapa string
the matplotlib colormap for the heatmap
default value is ocean
classical default value in matplotlib is viridis
rangeis None

compulsory for callind 2D histogram

loga boolean
whether to translate the densities in a logarithmic scale
default value is True
scalea boolean
deprecated
default value is False
titlea string
the title of the heatmap
default value is None (no title)
x11a boolean
whether to display the plot on the screen
default value is True (plot displayed)
plotfilea string
the name of the file where to save the plot
default value is None (plot not saved)
fmta string
format of the file where the plot is saved
possible values are : png, eps, pdf
default 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