stereo.plots.PlotVec.plot_vec#
- PlotVec.plot_vec(x_raw, y_raw, ty_raw, ptime, type='vec', count_thresh=0, tick_step=4000, line_len_co=1, vec_alpha=1, line_width=0.0025, density=2, background=None, background_alpha=0.5, num_pix=50, filter_type='gauss', sigma_val=0.4, radius_val=1, scatter_s=1, seed_val=1, num_legend_per_col=12, dpi_val=1000)[source]#
Plot vectors or streams of pseudo-time.
- Parameters:
x_raw – Array of x coordinates, taken from the first column in adata spatial axis array
y_raw – Array of y coordinates, taken from the second column in adata spatial axis array
ty_raw – 1d NdArray, involving cell types of all cells, or bin sets, can take the format of either string, int, or float
ptime – Array of pseudo-time, suggested being calculated by StereoPy dpt process
type – ‘vec’ or ‘vector’ plots vector plots, ‘stream’ or ‘streamplot’ plots stream plots
count_thresh – threshold of counts when filtering spots to plot
tick_step – step between tick labels
line_len_co – length coeeficient of vectors
vec_alpha – transparency of vectors, 0-1
line_width – width of vectors
density – density of streams in stream plot
background – ‘field’ plots fields-like background, with pixel color representing cell types, while ‘scatter’, ‘cell’, ‘bin’, or ‘spot’ plots each spot as a scatter
background_alpha – transparency of background
num_pix – number of pixel on shorter axis (x or y) when plotting background as fields
filter_type – type of kernel when smoothing vectors, if type is ‘vec’ or ‘vector’. Pass ‘gauss’ to use Gaussian kernel, pass ‘mean’ to use Mean kernel.
sigma_val – sigma of kernel if passing ‘gauss’ to filter_type
radius_val – half of width of kernel array, if passing ‘mean’ to filter_type
scatter_s – size of scatter, if passing ‘scatter’, ‘cell’, ‘bin’, or ‘spot’ to background
seed_val – seed value to assign colors for different cell types when plotting background
num_legend_per_col – number of lines per column in legend
dpi_val – dpi value of figure