spateo.plotting.static.three_d_plot.three_dims_plots ==================================================== .. py:module:: spateo.plotting.static.three_d_plot.three_dims_plots Functions --------- .. autoapisummary:: spateo.plotting.static.three_d_plot.three_dims_plots.wrap_to_plotter spateo.plotting.static.three_d_plot.three_dims_plots.three_d_plot spateo.plotting.static.three_d_plot.three_dims_plots.three_d_multi_plot spateo.plotting.static.three_d_plot.three_dims_plots.three_d_animate spateo.plotting.static.three_d_plot.three_dims_plots.merge_animations spateo.plotting.static.three_d_plot.three_dims_plots.quick_plot_3D_celltypes spateo.plotting.static.three_d_plot.three_dims_plots.plot_expression_3D spateo.plotting.static.three_d_plot.three_dims_plots.plot_multiple_genes_3D spateo.plotting.static.three_d_plot.three_dims_plots.visualize_3D_increasing_direction_gradient Module Contents --------------- .. py:function:: wrap_to_plotter(plotter: pyvista.Plotter, model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock], key: Union[str, list] = None, background: str = 'white', cpo: Union[str, list] = 'iso', colormap: Optional[Union[str, list]] = None, ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'surface', model_size: Union[float, list] = 3.0, show_legend: bool = True, legend_kwargs: Optional[dict] = None, show_outline: bool = False, outline_kwargs: Optional[dict] = None, text: Optional[str] = None, text_kwargs: Optional[dict] = None) What needs to be added to the visualization window. :param plotter: The plotting object to display pyvista/vtk model. :param model: A reconstructed model. :param key: The key under which are the labels. :param background: The background color of the window. :param cpo: Camera position of the active render window. Available ``cpo`` are: * Iterable containing position, focal_point, and view up. ``E.g.: [(2.0, 5.0, 13.0), (0.0, 0.0, 0.0), (-0.7, -0.5, 0.3)].`` * Iterable containing a view vector. ``E.g.: [-1.0, 2.0, -5.0].`` * A string containing the plane orthogonal to the view direction. ``E.g.: 'xy', 'xz', 'yz', 'yx', 'zx', 'zy', 'iso'.`` :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_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 show_outline: whether to produce an outline of the full extent for the model. :param outline_kwargs: A dictionary that will be pass to the ``add_outline`` function. By default, it is an empty dictionary and the `add_legend` function will use the ``{"outline_width": 5.0, "outline_color": "black", "show_labels": True, "font_size": 16, "font_color": "white", "font_family": "arial"}`` 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. .. py:function:: three_d_plot(model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock], key: Union[str, list] = None, filename: Optional[str] = None, jupyter: Union[bool, Literal['panel', 'none', 'pythreejs', 'static', 'ipygany', 'html']] = False, off_screen: bool = False, window_size: tuple = (512, 512), background: str = 'white', cpo: Union[str, list] = 'iso', colormap: Optional[Union[str, list]] = None, ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'surface', model_size: Union[float, list] = 3.0, show_legend: bool = True, legend_kwargs: Optional[dict] = None, show_outline: bool = False, outline_kwargs: Optional[dict] = None, text: Optional[str] = None, text_kwargs: Optional[dict] = None, view_up: tuple = (0.5, 0.5, 1), framerate: int = 24, plotter_filename: Optional[str] = None, show_axes: bool = False) Visualize reconstructed 3D model. :param model: A reconstructed model. :param key: The key under which are the labels. :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'``. * 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 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 cpo: Camera position of the active render window. Available ``cpo`` are: * Iterable containing position, focal_point, and view up. ``E.g.: [(2.0, 5.0, 13.0), (0.0, 0.0, 0.0), (-0.7, -0.5, 0.3)].`` * Iterable containing a view vector. ``E.g.: [-1.0, 2.0, -5.0].`` * A string containing the plane orthogonal to the view direction. ``E.g.: 'xy', 'xz', 'yz', 'yx', 'zx', 'zy', 'iso'.`` :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_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 show_outline: whether to produce an outline of the full extent for the model. :param outline_kwargs: A dictionary that will be pass to the ``add_outline`` function. By default, it is an empty dictionary and the `add_legend` function will use the ``{"outline_width": 5.0, "outline_color": "black", "show_labels": True, "font_size": 16, "font_color": "white", "font_family": "arial"}`` 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 view_up: The normal to the orbital plane. Only available when filename ending with ``.mp4`` or ``.gif``. :param framerate: Frames per second. Only available when filename ending with ``.mp4`` or ``.gif``. :param plotter_filename: The filename of the file where the plotter is saved. Writer type is inferred from the extension of the filename. * Output a gltf file, please enter a filename ending with ``.gltf``. * Output a html file, please enter a filename ending with ``.html``. * Output an obj file, please enter a filename ending with ``.obj``. * Output a vtkjs file, please enter a filename without format. :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 .. py:function:: three_d_multi_plot(model: Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock], key: Union[str, list] = None, filename: Optional[str] = None, jupyter: Union[bool, Literal['panel', 'none', 'pythreejs', 'static', 'ipygany', 'html']] = False, off_screen: bool = False, shape: Union[str, list, tuple] = None, window_size: Optional[tuple] = None, background: str = 'white', cpo: Union[str, list] = 'iso', colormap: Optional[Union[str, list]] = None, ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'surface', model_size: Union[float, list] = 3.0, show_legend: bool = True, legend_kwargs: Optional[dict] = None, show_outline: bool = False, outline_kwargs: Optional[dict] = None, text: Union[str, list] = None, text_kwargs: Optional[dict] = None, view_up: tuple = (0.5, 0.5, 1), framerate: int = 24, plotter_filename: Optional[str] = None) Multi-view visualization of reconstructed 3D model. If you want to draw a legend in each sub-window, please ensure that the key names used in each legend are different. :param model: A MultiBlock of reconstructed models or a reconstructed model. :param key: The key under which are the labels. :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'``. * 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 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 is only one 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, 512]``. :param background: The background color of the window. :param cpo: Camera position of the active render window. Available ``cpo`` are: * Iterable containing position, focal_point, and view up. ``E.g.: [(2.0, 5.0, 13.0), (0.0, 0.0, 0.0), (-0.7, -0.5, 0.3)].`` * Iterable containing a view vector. ``E.g.: [-1.0, 2.0, -5.0].`` * A string containing the plane orthogonal to the view direction. ``E.g.: 'xy', 'xz', 'yz', 'yx', 'zx', 'zy', 'iso'.`` :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_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 show_outline: whether to produce an outline of the full extent for the model. :param outline_kwargs: A dictionary that will be pass to the ``add_outline`` function. By default, it is an empty dictionary and the `add_legend` function will use the ``{"outline_width": 5.0, "outline_color": "black", "show_labels": True, "font_size": 16, "font_color": "white", "font_family": "arial"}`` 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 view_up: The normal to the orbital plane. Only available when filename ending with ``.mp4`` or ``.gif``. :param framerate: Frames per second. Only available when filename ending with ``.mp4`` or ``.gif``. :param plotter_filename: The filename of the file where the plotter is saved. Writer type is inferred from the extension of the filename. * Output a gltf file, please enter a filename ending with ``.gltf``. * Output a html file, please enter a filename ending with ``.html``. * Output an obj file, please enter a filename ending with ``.obj``. * Output a vtkjs file, please enter a filename without format. .. py:function:: three_d_animate(models: Union[List[PolyData or UnstructuredGrid], pyvista.MultiBlock], stable_model: Optional[Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock]] = None, stable_kwargs: Optional[dict] = None, key: Optional[str] = None, filename: str = 'animate.mp4', jupyter: Union[bool, Literal['panel', 'none', 'pythreejs', 'static', 'ipygany', 'html']] = False, off_screen: bool = False, window_size: tuple = (512, 512), background: str = 'white', cpo: Union[str, list] = 'iso', colormap: Optional[Union[str, list]] = None, ambient: Union[float, list] = 0.2, opacity: Union[float, numpy.ndarray, list] = 1.0, model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'surface', model_size: Union[float, list] = 3.0, show_legend: bool = True, legend_kwargs: Optional[dict] = None, show_outline: bool = False, outline_kwargs: Optional[dict] = None, text: Optional[str] = None, text_kwargs: Optional[dict] = None, framerate: int = 24, plotter_filename: Optional[str] = None) Animated visualization of 3D reconstruction model. :param models: A List of reconstructed models or a MultiBlock. :param stable_model: The model that do not change with time in animation. :param stable_kwargs: Parameters for plotting stable model. Available ``stable_kwargs`` are: * ``'key'`` * ``'ambient'`` * ``'opacity'`` * ``'model_style'`` * ``'model_size'`` * ``'background'`` * ``'show_legend'`` * ``'legend_kwargs'`` * ``'show_outline'`` * ``'outline_kwargs'`` * ``'text'`` * ``'text_kwargs'`` :param key: The key under which are the labels. :param filename: Filename of output file. Writer type is inferred from the extension of the filename. * 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 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 cpo: Camera position of the active render window. Available ``cpo`` are: * Iterable containing position, focal_point, and view up. ``E.g.: [(2.0, 5.0, 13.0), (0.0, 0.0, 0.0), (-0.7, -0.5, 0.3)].`` * Iterable containing a view vector. ``E.g.: [-1.0, 2.0, -5.0].`` * A string containing the plane orthogonal to the view direction. ``E.g.: 'xy', 'xz', 'yz', 'yx', 'zx', 'zy', 'iso'.`` :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_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 show_outline: whether to produce an outline of the full extent for the model. :param outline_kwargs: A dictionary that will be pass to the ``add_outline`` function. By default, it is an empty dictionary and the `add_legend` function will use the ``{"outline_width": 5.0, "outline_color": "black", "show_labels": True, "font_size": 16, "font_color": "white", "font_family": "arial"}`` 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 framerate: Frames per second. Only available when filename ending with ``.mp4`` or ``.gif``. :param plotter_filename: The filename of the file where the plotter is saved. Writer type is inferred from the extension of the filename. * Output a gltf file, please enter a filename ending with ``.gltf``. * Output a html file, please enter a filename ending with ``.html``. * Output an obj file, please enter a filename ending with ``.obj``. * Output a vtkjs file, please enter a filename without format. .. py:function:: merge_animations(mp4_files: Optional[list] = None, mp4_folder: Optional[list] = None, filename: str = 'merged_animation.mp4') Use MoviePy to compose a new animation and play multiple animations together in the new animation. :param mp4_files: A list containing absolute paths to mp4 files that need to be played together. :param mp4_folder: Absolute path to the folder containing all mp4 files that need to be played together. If ``mp4_files`` is provided, ``mp4_folder`` cannot also be provided. :param filename: Absolute path to save the newly composed animation. .. rubric:: Examples st.pl.merge_animations(mp4_files=["animation1.mp4", "animation2.mp4"], filename=f"merged_animation.mp4") .. py:function:: quick_plot_3D_celltypes(adata: anndata.AnnData, save_path: str, colors: Optional[list] = None, coords_key: str = 'spatial', group_key: str = 'celltype', opacity: float = 1.0, title: Optional[str] = None, ct_subset: Optional[list] = None, size: float = 2.0) Using plotly, save a 3D plot where cells are drawn as points and colored by their cell type. :param adata: AnnData object containing spatial coordinates and cell type labels :param save_path: Path to save the plot :param colors: Optional, used to specify colors for each cell type, given as a list that is at least as long as the set of cell types (in the AnnData object if all cell types are used, and in "ct_subset" if "ct_subset" is given). If None, a default color palette will be used. :param coords_key: Key in adata.obsm where spatial coordinates are stored :param group_key: Key in adata.obs where cell type labels are stored :param opacity: Sets only the transparency of the "Other" labeled points. Default is 1.0 (fully opaque). :param title: Optional, can be used to provide a title for the plot :param ct_subset: Optional, used to specify cell types of interest. If given, only cells with these types will be plotted, and other cells will be labeled "Other". If None, all cell types will be plotted. :param size: Size of the points in the plot. Defaults to 2. .. py:function:: plot_expression_3D(adata: anndata.AnnData, save_path: str, gene: str, coords_key: str = 'spatial', group_key: Optional[str] = None, ct_subset: Optional[list] = None, pcutoff: Optional[float] = 99.7, zero_opacity: float = 1.0, size: int = 2) Visualize gene expression in a 3D space. :param adata: AnnData object containing spatial coordinates and cell type labels :param save_path: Path to save the plot :param gene: Will plot expression pattern of this gene :param coords_key: Key in adata.obsm where spatial coordinates are stored :param group_key: Optional key for grouping in adata.obs, but needed if "ct_subset" is provided :param ct_subset: Optional list of cell types to include in the plot. If None, all cell types will be included. :param pcutoff: Percentile cutoff for gene expression. Default is 99.7, which will set the max value plotted to the 99.7th percentile of gene expression values. :param zero_opacity: Opacity of points with zero expression. Between 0.0 and 1.0. Default is 1.0. :param size: Size of the points in the plot. Defaults to 2. .. py:function:: plot_multiple_genes_3D(adata: anndata.AnnData, genes: list, save_path: str, colors: Optional[list] = None, coords_key: str = 'spatial', group_key: Optional[str] = None, ct_subset: Optional[list] = None, size: int = 2) Visualize the exclusivity or overlap of multiple gene expression patterns in 3D space. :param adata: An AnnData object containing gene expression data. :param genes: List of genes to visualize (e.g., ["gene1", "gene2", "gene3"]). :param save_path: Path to save the figure to (will save as HTML file). :param colors: Optional, list of colors to use for each gene. If None, will use a default Spateo color palette. Must be at least the same length as "genes", plus one. :param coords_key: Key for spatial coordinates in adata.obsm. :param group_key: Optional key for grouping in adata.obs, but needed if "ct_subset" is provided. :param ct_subset: Optional list of cell types to include in the plot. If None, all cell types will be included. :param size: Size of the points in the plot. Defaults to 2. .. py:function:: visualize_3D_increasing_direction_gradient(adata: anndata.AnnData, save_path: str, color_key: str = 'spatial', coord_key: str = 'spatial', coord_column: int = 0, cmap: str = 'viridis', center: float = 0.5, opacity: float = 1.0, title: Optional[str] = None) Given a key in adata.obsm or adata.obs and optionally a column index, plot a 3D scatterplot where points are colored according to increasing value in the specified column (typically, a coordinate axis, e.g. the y-axis). :param adata: AnnData object containing all required information :param save_path: Save the figure as an HTML file to this path :param color_key: Key in adata.obs or adata.obsm containing numerical information that will be used to color the cells with gradient. Defaults to "spatial" (the default assumption also for the key in .obsm containing spatial coordinates). :param coord_key: Key in adata.obsm specifying the coordinates of each point in 3D space. Defaults to "spatial". :param coord_column: Column index to use for plotting :param cmap: Colormap to use for plotting :param center: Coordinates will be normalized to [0, 1] and centered around this value. Defaults to 0.5. Larger values will result in more points being colored in the upper half of the colormap, and vice versa. :param opacity: Transparency of the points :param title: Optional, can be used to provide a title for the plot