Visualization Utilities

Visualization Utilities#

The deepspatial.vis_utils module provides a comprehensive suite of plotting tools tailored for 3D spatial transcriptomics. It supports both publication-quality static rendering via matplotlib and dynamic, browser-based exploration via plotly and ipywidgets.

Static Plotting#

Generate high-resolution, static visualizations optimized for publications and reports. These functions support rendering full 3D scatter plots, simulating physical tissue sectioning (virtual slices), and projecting 3D volumes onto 2D orthogonal planes.

plot_3d_labels

Generate a static 3D scatter plot colored by categorical labels.

plot_virtual_slice

Simulate physical sectioning and generate a virtual 2D/3D slice plot.

plot_orthogonal_projections

Generate static 2D orthogonal projections (XY, XZ, YZ) of the 3D data.

plot_z_distribution

Render a smoothed stacked area chart representing cell proportions along the Z-axis.

Interactive Plotting#

Browser-based, interactive rendering built on plotly and Jupyter Widgets. These tools allow users to dynamically rotate, zoom, and slice through the reconstructed 3D tissue volumes in real-time.

interactive_3d_labels

Generate an interactive Plotly 3D scatter plot for categorical metadata.

interactive_3d_expression

Generate an interactive Plotly 3D scatter plot for continuous gene expression.

interactive_spatial_range_widget

Generate a Jupyter widget for dynamically slicing and projecting 3D data onto a 2D plane.