scanpy.pl.MatrixPlot.style

scanpy.pl.MatrixPlot.style#

MatrixPlot.style(cmap=_empty, edge_color=_empty, edge_lw=_empty)[source]#

Modifies plot visual parameters.

Parameters:
cmap Colormap | str | None | Empty (default: _empty)

Matplotlib color map, specified by name or directly. If None, use matplotlib.rcParams["image.cmap"]

edge_color str | tuple[float, ...] | None | Empty (default: _empty)

Edge color between the squares of matrix plot. If None, use matplotlib.rcParams["patch.edgecolor"]

edge_lw float | None | Empty (default: _empty)

Edge line width. If None, use matplotlib.rcParams["lines.linewidth"]

Return type:

Self

Returns:

MatrixPlot

Examples

import scanpy as sc

adata = sc.datasets.pbmc68k_reduced()
markers = ['C1QA', 'PSAP', 'CD79A', 'CD79B', 'CST3', 'LYZ']

Change color map and turn off edges:

(
    sc.pl.MatrixPlot(adata, markers, groupby='bulk_labels')
    .style(cmap='Blues', edge_color='none')
    .show()
)
../../../_images/scanpy-pl-MatrixPlot-style-2.png