spateo.plotting.static.three_d_plot.backbone_plots ================================================== .. py:module:: spateo.plotting.static.three_d_plot.backbone_plots Functions --------- .. autoapisummary:: spateo.plotting.static.three_d_plot.backbone_plots.backbone Module Contents --------------- .. py:function:: backbone(backbone_model: pyvista.PolyData, backbone_key: str = 'backbone', backbone_model_size: Union[float, int] = 8, backbone_colormap: Optional[str] = None, backbone_ambient: Union[float, list] = 0.2, backbone_opacity: Union[float, numpy.ndarray, list] = 1.0, nodes_key: Optional[str] = 'nodes', nodes_label_size: Union[float, int] = 18, bg_model: Optional[Union[pyvista.PolyData, pyvista.UnstructuredGrid, pyvista.MultiBlock]] = None, bg_key: Optional[Union[str, list]] = None, bg_model_style: Union[Literal['points', 'surface', 'wireframe'], list] = 'points', bg_model_size: Union[float, list] = 10, bg_colormap: Optional[Union[str, list]] = None, bg_ambient: Union[float, list] = 0.2, bg_opacity: Union[float, numpy.ndarray, list] = 0.6, show_axes: bool = True, show_legend: bool = True, legend_kwargs: Optional[dict] = None, filename: Optional[str] = None, jupyter: Union[bool, Literal['none', 'static', 'trame']] = False, off_screen: bool = False, window_size: tuple = (2048, 2048), background: str = 'white', cpo: Union[str, list] = 'iso', **kwargs) Visualize constructed 3D backbone model. :param backbone_model: The constructed backbone model. :param backbone_key: Any point_data names or cell_data names to be used for coloring ``backbone_model``. :param backbone_model_size: The thickness of backbone. :param backbone_colormap: Name of the Matplotlib colormap to use when mapping the scalars of ``backbone_model``. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param backbone_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 backbone_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 nodes_key: The key that corresponds to the coordinates of the nodes in the backbone. :param nodes_label_size: Sets the size of the title font. :param bg_model: The background model used to construct backbone model. :param bg_key: Any point_data names or cell_data names to be used for coloring ``bg_model``. :param bg_model_style: Visualization style of ``bg_model``. One of the following: * ``bg_model_style = 'surface'``, * ``bg_model_style = 'wireframe'``, * ``bg_model_style = 'points'``. :param bg_model_size: If ``bg_model_style = 'points'``, point size of any nodes in the dataset plotted. If ``bg_model_style = 'wireframe'``, thickness of lines. :param bg_colormap: Name of the Matplotlib colormap to use when mapping the scalars of ``bg_model``. When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars. :param bg_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 bg_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 show_axes: Whether to add a camera orientation widget to the active renderer. :param show_legend: whether to add a legend of ``bg_model`` 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 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``. :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 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 \*\*kwargs: Additional parameters that will be passed to ``.add_point_labels`` 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