scanpy.pl.StackedViolin.style
- StackedViolin.style(cmap='Blues', stripplot=False, jitter=False, jitter_size=1, linewidth=0.2, row_palette=None, scale='width', yticklabels=False, ylim=None, x_padding=0.5, y_padding=0.5)
Modifies plot visual parameters
- Parameters
- cmap :
str
|None
Optional
[str
] (default:'Blues'
) String denoting matplotlib color map.
- stripplot :
bool
|None
Optional
[bool
] (default:False
) Add a stripplot on top of the violin plot. See
stripplot()
.- jitter :
float
|bool
|None
Union
[float
,bool
,None
] (default:False
) Add jitter to the stripplot (only when stripplot is True) See
stripplot()
.- jitter_size :
int
|None
Optional
[int
] (default:1
) Size of the jitter points.
- linewidth :
float
|None
Optional
[float
] (default:0.2
) linewidth for the violin plots.
- row_palette :
str
|None
Optional
[str
] (default:None
) The row palette determines the colors to use for the stacked violins. The value should be a valid seaborn or matplotlib palette name (see
color_palette()
). Alternatively, a single color name or hex value can be passed, e.g.'red'
or'#cc33ff'
.- scale : {‘area’, ‘count’, ‘width’} |
None
Optional
[Literal
[‘area’, ‘count’, ‘width’]] (default:'width'
) The method used to scale the width of each violin. If ‘width’ (the default), each violin will have the same width. If ‘area’, each violin will have the same area. If ‘count’, a violin’s width corresponds to the number of observations.
- yticklabels :
bool
|None
Optional
[bool
] (default:False
) Set to true to view the y tick labels.
- ylim :
Tuple
[float
,float
] |None
Optional
[Tuple
[float
,float
]] (default:None
) minimum and maximum values for the y-axis. If set. All rows will have the same y-axis range. Example: ylim=(0, 5)
- x_padding :
float
|None
Optional
[float
] (default:0.5
) Space between the plot left/right borders and the violins. A unit is the distance between the x ticks.
- y_padding :
float
|None
Optional
[float
] (default:0.5
) Space between the plot top/bottom borders and the violins. A unit is the distance between the y ticks.
- cmap :
- Returns
Examples
>>> 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(row_palette='Blues', linewidth=0).show()