sme_contrib.plot.facet_grid3D
- sme_contrib.plot.facet_grid3D(data: dict[str, ndarray], plotfuncs: dict[str, Callable], show_cmap: bool = False, cmap: str | ndarray | LookupTable = 'viridis', portrait: bool = False, linked_views: bool = True, plotter_kwargs: dict | None = None, plotfuncs_kwargs: dict[str, dict[str, Any]] | None = None) Plotter
Create a 3D facet plot using PyVista.
This follows the seaborn.FacetGrid concept. This function creates a grid of subplots where each subplot is filled by a function in the plotfuncs argument. The keys for plotfuncs and data must be the same, such that plotfuncs can be unambiguously mapped over the data dictionary. Do not attempt to plot 2D images and 3D images into the same facet grid, as this will create odd artifacts and may not work as expected.
- Parameters:
data – (dict[str, np.ndarray]) A dictionary where keys are labels and values are numpy arrays containing the data to be plotted.
plotfuncs – (dict[str, Callable]) A dictionary where keys are labels and values are functions with signature
f(label:str, data:np.ndarray | pyvista.ImageData | pyvista.UniformGrid, plotter:Plotter, panel:tuple[int, int], show_cmap:bool=show_cmap, cmap=cmap, **plotfuncs_kwargs )-> Noneshow_cmap – bool, optional Whether to show the color map. Default is False.
cmap – (str | np.ndarray | LookupTable), optional The color map to use. Default is “viridis”.
portrait – (bool), optional Whether to use a portrait layout. Default is False.
linked_views – (bool), optional Whether to link the views of the subplots. Default is True.
plotter_kwargs – (dict, optional) Additional keyword arguments to pass to the PyVista Plotter.
plotfuncs_kwargs – (dict[str, dict[str, Any]]), optional Additional keyword arguments to pass to each plotting function.
- Returns:
Plotter The PyVista Plotter object with the created facet plot.