dynamo.pl.plot_3d_streamtube

dynamo.pl.plot_3d_streamtube(adata, color, layer, group, init_group, basis='umap', dims=[0, 1, 2], theme=None, background=None, cmap=None, color_key=None, color_key_cmap=None, html_fname=None, save_show_or_return='show', save_kwargs={})[source]

Plot a interative 3d streamtube plot via plotly.

A streamtube is a tubular region surrounded by streamlines that form a closed loop. It’s a continuous version of a streamtube plot (3D quiver plot) and can provide insight into flow data from natural systems. The color of tubes is determined by their local norm, and the diameter of the field by the local divergence of the vector field.

Parameters:
  • adata (AnnData) – An Annodata object, must have vector field reconstructed for the input basis whose dimension should at least 3D.

  • color (string (default: ntr)) – Any column names or gene expression, etc. that will be used for coloring cells.

  • group (str) – The column names of adata.obs that will be used to search for cells, together with init_group to set the initial state of the streamtube.

  • init_group (str) – The group name among all names in group that will be used to set the initial states of the stream tube.

  • basis (str) – The reduced dimension.

  • html_fname (str or None) – html file name that will be use to save the streamtube interactive plot.

  • dims (list (default: [0, 1, 2])) – The number of dimensions that will be used to construct the vector field for streamtube plot.

  • save_show_or_return (str {‘save’, ‘show’, ‘return’} (default: show)) – Whether to save, show or return the figure.

  • save_kwargs (dict (default: {})) – A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig function will use the {“path”: None, “prefix”: ‘scatter’, “dpi”: None, “ext”: ‘pdf’, “transparent”: True, “close”: True, “verbose”: True} as its parameters. Otherwise you can provide a dictionary that properly modify those keys according to your needs.

Returns:

Nothing but render an interactive streamtube plot. If html_fname is not None, the plot will save to a html file.