spateo.plotting.static.three_d_plot.morphometrics_plots ======================================================= .. py:module:: spateo.plotting.static.three_d_plot.morphometrics_plots Functions --------- .. autoapisummary:: spateo.plotting.static.three_d_plot.morphometrics_plots._check_index_in_adata spateo.plotting.static.three_d_plot.morphometrics_plots._check_key_in_adata spateo.plotting.static.three_d_plot.morphometrics_plots.jacobian spateo.plotting.static.three_d_plot.morphometrics_plots.feature spateo.plotting.static.three_d_plot.morphometrics_plots.torsion spateo.plotting.static.three_d_plot.morphometrics_plots.acceleration spateo.plotting.static.three_d_plot.morphometrics_plots.curvature spateo.plotting.static.three_d_plot.morphometrics_plots.curl spateo.plotting.static.three_d_plot.morphometrics_plots.divergence Module Contents --------------- .. py:function:: _check_index_in_adata(adata, model) .. py:function:: _check_key_in_adata(adata: anndata.AnnData, key: str, where: str) .. py:function:: jacobian(adata: anndata.AnnData, model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock, list], jacobian_key: str = 'jacobian', filename: Optional[str] = None, jupyter: Union[bool, Literal['none', 'static', 'trame']] = False, off_screen: bool = False, shape: Union[str, list, tuple] = (3, 3), window_size: Optional[tuple] = (512 * 3, 512 * 3), background: str = 'black', colormap: Optional[Union[str, list]] = 'default_cmap', ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'points', model_size: Union[float, list] = 3.0, show_axes: bool = True, show_legend: bool = True, legend_kwargs: Optional[dict] = None, text: Union[bool, str] = True, text_kwargs: Optional[dict] = None, **kwargs) Visualize the jacobian result. :param adata: An anndata object contain jacobian matrix in ``.uns[jacobian_key]``. :param model: A reconstructed model contains ``obs_index`` values. :param jacobian_key: The key in ``.uns`` that corresponds to the jacobian matrix in the anndata object. :param filename: Filename of output file. Writer type is inferred from the extension of the filename. * Output an image file,please enter a filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. When ``jupyter=False``, if you want to save '.png' file, please ensure ``off_screen=True``. * Output a gif file, please enter a filename ending with ``.gif``. * Output a mp4 file, please enter a filename ending with ``.mp4``. :param jupyter: Whether to plot in jupyter notebook. Available ``jupyter`` are: * ``'none'`` - Do not display in the notebook. * ``'trame'`` - Show a trame widget * ``'static'`` - Display a static figure. :param off_screen: Renders off-screen when True. Useful for automated screenshots. :param shape: Number of sub-render windows inside the main window. By default, there are nine render window. * Specify two across with ``shape``=(2, 1) and a two by two grid with ``shape``=(2, 2). * ``shape`` Can also accept a string descriptor as shape. ``E.g.: shape="3|1" means 3 plots on the left and 1 on the right,`` ``E.g.: shape="4/2" means 4 plots on top and 2 at the bottom.`` :param window_size: Window size in pixels. The default window_size is ``[512*3, 512*3]``. :param background: The background color of the window. :param colormap: Name of the Matplotlib colormap to use when mapping the scalars. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param ambient: When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer. :param opacity: Opacity of the model. If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1. A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: 'linear', 'linear_r', 'geom', 'geom_r'). :param model_style: Visualization style of the model. One of the following: * ``model_style = 'surface'``, * ``model_style = 'wireframe'``, * ``model_style = 'points'``. :param model_size: If ``model_style = 'points'``, point size of any nodes in the dataset plotted. If ``model_style = 'wireframe'``, thickness of lines. :param show_axes: Whether to add a camera orientation widget to the active renderer. :param show_legend: whether to add a legend to the plotter. :param legend_kwargs: A dictionary that will be pass to the ``add_legend`` function. By default, it is an empty dictionary and the ``add_legend`` function will use the ``{"legend_size": None, "legend_loc": None, "legend_size": None, "legend_loc": None, "title_font_size": None, "label_font_size": None, "font_family": "arial", "fmt": "%.2e", "n_labels": 5, "vertical": True}`` as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs. :param text: The text to add the rendering. :param text_kwargs: A dictionary that will be pass to the ``add_text`` function. By default, it is an empty dictionary and the ``add_legend`` function will use the ``{ "font_family": "arial", "font_size": 12, "font_color": "black", "text_loc": "upper_left"}`` as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs. :param \*\*kwargs: Additional parameters that will be passed into the ``st.pl.three_d_multi_plot`` function. :returns: List of camera position, focal point, and view up. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. img: Numpy array of the last image. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. :rtype: cpo .. rubric:: Examples Visualize only in one model: st.pl.jacobian( adata=stage_adata, model=stage_pc, jacobian_key="jacobian", jupyter="static", model_style="points", model_size=3 ) Visualize in multiple model: st.pl.jacobian( adata=stage_adata, model=[stage_pc, trajectory_model], jacobian_key="jacobian", jupyter="static", model_style=["points", "wireframe"], model_size=[3, 1] ) .. py:function:: feature(adata: anndata.AnnData, model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock, list], feature_key: str, filename: Optional[str] = None, jupyter: Union[bool, Literal['none', 'static', 'trame']] = False, off_screen: bool = False, window_size: Optional[tuple] = (512, 512), background: str = 'black', colormap: Optional[Union[str, list]] = 'default_cmap', ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'points', model_size: Union[float, list] = 3.0, show_axes: bool = True, show_legend: bool = True, legend_kwargs: Optional[dict] = dict(title=''), text: Union[bool, str] = True, text_kwargs: Optional[dict] = None, **kwargs) Visualize the feature values. :param adata: An anndata object contain feature values in ``.obs[feature_key]``. :param model: A reconstructed model contains ``obs_index`` values. :param feature_key: The key in ``.obs`` that corresponds to the feature values in the anndata object. :param filename: Filename of output file. Writer type is inferred from the extension of the filename. * Output an image file,please enter a filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. When ``jupyter=False``, if you want to save '.png' file, please ensure ``off_screen=True``. * Output a gif file, please enter a filename ending with ``.gif``. * Output a mp4 file, please enter a filename ending with ``.mp4``. :param jupyter: Whether to plot in jupyter notebook. Available ``jupyter`` are: * ``'none'`` - Do not display in the notebook. * ``'trame'`` - Show a trame widget * ``'static'`` - Display a static figure. :param off_screen: Renders off-screen when True. Useful for automated screenshots. :param window_size: Window size in pixels. The default window_size is ``[512, 512]``. :param background: The background color of the window. :param colormap: Name of the Matplotlib colormap to use when mapping the scalars. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param ambient: When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer. :param opacity: Opacity of the model. If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1. A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: 'linear', 'linear_r', 'geom', 'geom_r'). :param model_style: Visualization style of the model. One of the following: * ``model_style = 'surface'``, * ``model_style = 'wireframe'``, * ``model_style = 'points'``. :param model_size: If ``model_style = 'points'``, point size of any nodes in the dataset plotted. If ``model_style = 'wireframe'``, thickness of lines. :param show_axes: Whether to add a camera orientation widget to the active renderer. :param show_legend: whether to add a legend to the plotter. :param legend_kwargs: A dictionary that will be pass to the ``add_legend`` function. By default, it is an empty dictionary and the ``add_legend`` function will use the ``{"legend_size": None, "legend_loc": None, "legend_size": None, "legend_loc": None, "title_font_size": None, "label_font_size": None, "font_family": "arial", "fmt": "%.2e", "n_labels": 5, "vertical": True}`` as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs. :param text: The text to add the rendering. :param text_kwargs: A dictionary that will be pass to the ``add_text`` function. By default, it is an empty dictionary and the ``add_legend`` function will use the ``{ "font_family": "arial", "font_size": 12, "font_color": "black", "text_loc": "upper_left"}`` as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs. :param \*\*kwargs: Additional parameters that will be passed into the ``st.pl.three_d_plot`` function. .. rubric:: Examples Visualize only in one model: st.pl.feature( adata=stage_adata, model=stage_pc, feature_key="torsion", jupyter="static", model_style="points", model_size=3 ) Visualize in multiple model: st.pl.feature( adata=stage_adata, model=[stage_pc, trajectory_model], feature_key="torsion", jupyter="static", model_style=["points", "wireframe"], model_size=[3, 1] ) .. py:function:: torsion(adata: anndata.AnnData, model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock, list], torsion_key: str = 'torsion', filename: Optional[str] = None, jupyter: Union[bool, Literal['none', 'static', 'trame']] = False, colormap: Optional[Union[str, list]] = 'default_cmap', ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'points', model_size: Union[float, list] = 3.0, **kwargs) Visualize the torsion result. :param adata: An anndata object contain torsion values in ``.obs[torsion_key]``. :param model: A reconstructed model contains ``obs_index`` values. :param torsion_key: The key in ``.obs`` that corresponds to the torsion values in the anndata object. :param filename: Filename of output file. Writer type is inferred from the extension of the filename. * Output an image file,please enter a filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. When ``jupyter=False``, if you want to save '.png' file, please ensure ``off_screen=True``. * Output a gif file, please enter a filename ending with ``.gif``. * Output a mp4 file, please enter a filename ending with ``.mp4``. :param jupyter: Whether to plot in jupyter notebook. Available ``jupyter`` are: * ``'none'`` - Do not display in the notebook. * ``'trame'`` - Show a trame widget * ``'static'`` - Display a static figure. :param colormap: Name of the Matplotlib colormap to use when mapping the scalars. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param ambient: When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer. :param opacity: Opacity of the model. If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1. A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: 'linear', 'linear_r', 'geom', 'geom_r'). :param model_style: Visualization style of the model. One of the following: * ``model_style = 'surface'``, * ``model_style = 'wireframe'``, * ``model_style = 'points'``. :param model_size: If ``model_style = 'points'``, point size of any nodes in the dataset plotted. If ``model_style = 'wireframe'``, thickness of lines. :param \*\*kwargs: Additional parameters that will be passed into the ``st.pl.feature`` function. :returns: List of camera position, focal point, and view up. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. img: Numpy array of the last image. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. :rtype: cpo .. rubric:: Examples Visualize only in one model: st.pl.torsion( adata=stage_adata, model=stage_pc, torsion_key="torsion", jupyter="static", model_style="points", model_size=3 ) Visualize in multiple model: st.pl.torsion( adata=stage_adata, model=[stage_pc, trajectory_model], torsion_key="torsion", jupyter="static", model_style=["points", "wireframe"], model_size=[3, 1] ) .. py:function:: acceleration(adata: anndata.AnnData, model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock, list], acceleration_key: str = 'acceleration', filename: Optional[str] = None, jupyter: Union[bool, Literal['none', 'static', 'trame']] = False, colormap: Optional[Union[str, list]] = 'default_cmap', ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'points', model_size: Union[float, list] = 3.0, **kwargs) Visualize the torsion result. :param adata: An anndata object contain acceleration values in ``.obs[acceleration_key]``. :param model: A reconstructed model contains ``obs_index`` values. :param acceleration_key: The key in ``.obs`` that corresponds to the acceleration values in the anndata object. :param filename: Filename of output file. Writer type is inferred from the extension of the filename. * Output an image file,please enter a filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. When ``jupyter=False``, if you want to save '.png' file, please ensure ``off_screen=True``. * Output a gif file, please enter a filename ending with ``.gif``. * Output a mp4 file, please enter a filename ending with ``.mp4``. :param jupyter: Whether to plot in jupyter notebook. Available ``jupyter`` are: * ``'none'`` - Do not display in the notebook. * ``'trame'`` - Show a trame widget * ``'static'`` - Display a static figure. :param colormap: Name of the Matplotlib colormap to use when mapping the scalars. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param ambient: When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer. :param opacity: Opacity of the model. If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1. A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: 'linear', 'linear_r', 'geom', 'geom_r'). :param model_style: Visualization style of the model. One of the following: * ``model_style = 'surface'``, * ``model_style = 'wireframe'``, * ``model_style = 'points'``. :param model_size: If ``model_style = 'points'``, point size of any nodes in the dataset plotted. If ``model_style = 'wireframe'``, thickness of lines. :param \*\*kwargs: Additional parameters that will be passed into the ``st.pl.feature`` function. :returns: List of camera position, focal point, and view up. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. img: Numpy array of the last image. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. :rtype: cpo .. rubric:: Examples Visualize only in one model: st.pl.acceleration( adata=stage_adata, model=stage_pc, acceleration_key="acceleration", jupyter="static", model_style="points", model_size=3 ) Visualize in multiple model: st.pl.acceleration( adata=stage_adata, model=[stage_pc, trajectory_model], acceleration_key="acceleration", jupyter="static", model_style=["points", "wireframe"], model_size=[3, 1] ) .. py:function:: curvature(adata: anndata.AnnData, model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock, list], curvature_key: str = 'curvature', filename: Optional[str] = None, jupyter: Union[bool, Literal['none', 'static', 'trame']] = False, colormap: Optional[Union[str, list]] = 'default_cmap', ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'points', model_size: Union[float, list] = 3.0, **kwargs) Visualize the curvature result. :param adata: An anndata object contain curvature values in ``.obs[curvature_key]``. :param model: A reconstructed model contains ``obs_index`` values. :param curvature_key: The key in ``.obs`` that corresponds to the curvature values in the anndata object. :param filename: Filename of output file. Writer type is inferred from the extension of the filename. * Output an image file,please enter a filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. When ``jupyter=False``, if you want to save '.png' file, please ensure ``off_screen=True``. * Output a gif file, please enter a filename ending with ``.gif``. * Output a mp4 file, please enter a filename ending with ``.mp4``. :param jupyter: Whether to plot in jupyter notebook. Available ``jupyter`` are: * ``'none'`` - Do not display in the notebook. * ``'trame'`` - Show a trame widget * ``'static'`` - Display a static figure. :param colormap: Name of the Matplotlib colormap to use when mapping the scalars. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param ambient: When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer. :param opacity: Opacity of the model. If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1. A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: 'linear', 'linear_r', 'geom', 'geom_r'). :param model_style: Visualization style of the model. One of the following: * ``model_style = 'surface'``, * ``model_style = 'wireframe'``, * ``model_style = 'points'``. :param model_size: If ``model_style = 'points'``, point size of any nodes in the dataset plotted. If ``model_style = 'wireframe'``, thickness of lines. :param \*\*kwargs: Additional parameters that will be passed into the ``st.pl.feature`` function. :returns: List of camera position, focal point, and view up. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. img: Numpy array of the last image. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. :rtype: cpo .. rubric:: Examples Visualize only in one model: st.pl.curvature( adata=stage_adata, model=stage_pc, curvature_key="curvature", jupyter="static", model_style="points", model_size=3 ) Visualize in multiple model: st.pl.curvature( adata=stage_adata, model=[stage_pc, trajectory_model], curvature_key="curvature", jupyter="static", model_style=["points", "wireframe"], model_size=[3, 1] ) .. py:function:: curl(adata: anndata.AnnData, model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock, list], curl_key: str = 'curl', filename: Optional[str] = None, jupyter: Union[bool, Literal['none', 'static', 'trame']] = False, colormap: Optional[Union[str, list]] = 'default_cmap', ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'points', model_size: Union[float, list] = 3.0, **kwargs) Visualize the curl result. :param adata: An anndata object contain curl values in ``.obs[curl_key]``. :param model: A reconstructed model contains ``obs_index`` values. :param curl_key: The key in ``.obs`` that corresponds to the curl values in the anndata object. :param filename: Filename of output file. Writer type is inferred from the extension of the filename. * Output an image file,please enter a filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. When ``jupyter=False``, if you want to save '.png' file, please ensure ``off_screen=True``. * Output a gif file, please enter a filename ending with ``.gif``. * Output a mp4 file, please enter a filename ending with ``.mp4``. :param jupyter: Whether to plot in jupyter notebook. Available ``jupyter`` are: * ``'none'`` - Do not display in the notebook. * ``'trame'`` - Show a trame widget * ``'static'`` - Display a static figure. :param colormap: Name of the Matplotlib colormap to use when mapping the scalars. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param ambient: When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer. :param opacity: Opacity of the model. If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1. A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: 'linear', 'linear_r', 'geom', 'geom_r'). :param model_style: Visualization style of the model. One of the following: * ``model_style = 'surface'``, * ``model_style = 'wireframe'``, * ``model_style = 'points'``. :param model_size: If ``model_style = 'points'``, point size of any nodes in the dataset plotted. If ``model_style = 'wireframe'``, thickness of lines. :param \*\*kwargs: Additional parameters that will be passed into the ``st.pl.feature`` function. :returns: List of camera position, focal point, and view up. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. img: Numpy array of the last image. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. :rtype: cpo .. rubric:: Examples Visualize only in one model: st.pl.curl( adata=stage_adata, model=stage_pc, curl_key="curl", jupyter="static", model_style="points", model_size=3 ) Visualize in multiple model: st.pl.curl( adata=stage_adata, model=[stage_pc, trajectory_model], curl_key="curl", jupyter="static", model_style=["points", "wireframe"], model_size=[3, 1] ) .. py:function:: divergence(adata: anndata.AnnData, model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock, list], divergence_key: str = 'divergence', filename: Optional[str] = None, jupyter: Union[bool, Literal['none', 'static', 'trame']] = False, colormap: Optional[Union[str, list]] = 'default_cmap', ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'points', model_size: Union[float, list] = 3.0, **kwargs) Visualize the divergence result. :param adata: An anndata object contain curl values in ``.obs[divergence_key]``. :param model: A reconstructed model contains ``obs_index`` values. :param divergence_key: The key in ``.obs`` that corresponds to the divergence values in the anndata object. :param filename: Filename of output file. Writer type is inferred from the extension of the filename. * Output an image file,please enter a filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. When ``jupyter=False``, if you want to save '.png' file, please ensure ``off_screen=True``. * Output a gif file, please enter a filename ending with ``.gif``. * Output a mp4 file, please enter a filename ending with ``.mp4``. :param jupyter: Whether to plot in jupyter notebook. Available ``jupyter`` are: * ``'none'`` - Do not display in the notebook. * ``'pythreejs'`` - Show a pythreejs widget * ``'static'`` - Display a static figure. * ``'ipygany'`` - Show an ipygany widget * ``'panel'`` - Show a panel widget. :param colormap: Name of the Matplotlib colormap to use when mapping the scalars. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param ambient: When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer. :param opacity: Opacity of the model. If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1. A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: 'linear', 'linear_r', 'geom', 'geom_r'). :param model_style: Visualization style of the model. One of the following: * ``model_style = 'surface'``, * ``model_style = 'wireframe'``, * ``model_style = 'points'``. :param model_size: If ``model_style = 'points'``, point size of any nodes in the dataset plotted. If ``model_style = 'wireframe'``, thickness of lines. :param \*\*kwargs: Additional parameters that will be passed into the ``st.pl.feature`` function. :returns: List of camera position, focal point, and view up. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. img: Numpy array of the last image. Returned only if filename is None or filename ending with ``'.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'``. :rtype: cpo .. rubric:: Examples Visualize only in one model: st.pl.divergence( adata=stage_adata, model=stage_pc, divergence_key="divergence", jupyter="static", model_style="points", model_size=3 ) Visualize in multiple model: st.pl.divergence( adata=stage_adata, model=[stage_pc, trajectory_model], divergence_key="divergence", jupyter="static", model_style=["points", "wireframe"], model_size=[3, 1] )