mdciao.plots.plot_matrix¶
-
mdciao.plots.
plot_matrix
(mat, labels, pixelsize=1, transpose=False, grid=False, cmap='binary', colorbar=False)¶ Plot a matrix using
imshow
.Matrx can be non-symmetric and rectangular, rows and columns need not represent the same residues or groups of residues
- Parameters
mat (2D numpy.ndarray of shape (N,M)) – The matrix to be plotted, NaNs are allowed
labels (list of len(2) with x and y labels) – The length of each list has to be N, M for x, y respectively, else this method fails
pixelsize (int, default is 1) – The size in inches of the pixel representing the contact. Ultimately controls the size of the figure, because figsize = _np.array(mat.shape)*pixelsize
transpose (bool, default is False) –
grid (boolean, default is False) – overlap a grid of dashed lines
cmap (str, default is 'binary') – What
matplotlib.cmap
to usecolorbar (boolean, default is False) – whether to use a colorbar
transpose – Transpose the matrix when plotting
- Returns
ax (
Axes
object)pixelsize (float, size of the pixel) – Helpful in cases where this method is called with the default value, in case the value changes in the future