Design choices make a big difference in the accuracy of our interpretations.
Design choices make a big difference in the accuracy of our interpretations.
Different ways of encoding information are perceived with different accuracies. This means that any visualization implicitly prioritizes some comparisons over others.

Figure from [1].
Effective visualization becomes even more difficult when we measure many features.
There’s only so much we can show in a single view.
Kuo, M., Lê Cao, K.-A., Kodikara, S., Mao, J., & Sankaran, K. (2026). phylobar: an R package for multiresolution compositional barplots in omics studies. Bioinformatics (Oxford, England), 42(4). doi:10.1093/bioinformatics/btag151
Stacked bar plots are used in microbiome research to compare composition across groups or over time.

Figure from the Qiime2 paper [2].
The basic limitation is that they can only show so many colors at a time. This makes it difficult to study rarer taxa.
Figure from the microbiomeViz documentation [3].
The basic limitation is that they can only show so many colors at a time. This makes it difficult to study rarer taxa.
Figure from the Qiime2 documentation [2].
The basic idea of phylobar is to use this tree structure (context) to interactively paint (focus) the stacked bar plot.
Figure from the phylobar documentation [4].
We can press the control or number keys to cycle across a color palette.
We can press the control or number keys to cycle across a color palette.
We can collapse and expand the tree and the barplot rectangles merge or split accordingly.
This idea works whenever you cared about hierarchically organized compositions, like this COVID-19 immunology data from [5].
We can embed these visualizations into quarto documents.
Sankaran, K., Zhang, S., Chenab, & Meilă, M. (2026). Interactive visualization of metric distortion in nonlinear data embeddings using the distortions package. Briefings in Bioinformatics, 27(2). doi:10.1093/bib/bbag136
Both \(t\)-SNE and UMAP introduce distortions. For example, they may not preserve density within different regions of the plot.
DensMAP is designed to address density distortion [6].
They can also fail to preserve the topology of the underlying data…
Example from [7].
These distortions are not mere technical curiosities – they significantly impact scientific interpretation [7–9]. For example, they create misleading differences between cell types that are actually similar.
scDEED tunes hyperparameters to improve embedding reliability [10].
Rather than abandoning nonlinear dimensionality reduction, we augment the embeddings to characterize distortion.
Our approach is similar to Tissot’s indicatrix [11] except the embedding map doesn’t have an analytical formula.


The RMetric method [12,13] estimates an embedding’s effect on a unit circle in the original space.
For a more global summary of distortion, we fit a running median to true vs. embedding neighbor distances, flag outliers above \(\sigma \times \text{IQR}\), and mark points with many outlier links as “fragmented.”
This is the classic Swiss Roll data, but with higher density near the endpoints.
\(t\)-SNE (perplexity = 100) breaks the roll in the low-density region and artificially spreads the high density area.
Both variation in ellipses and fragmented neighborhood statistics can be used to compare competing algorithms, similarly to [10,14].
Both variation in ellipses and fragmented neighborhood statistics can be used to compare competing algorithms, similarly to [10,14].
You can experiment with this method in the browser at this link:
The thread in both these projects is the focus-plus-context principle from data visualization [15].
We allowed the viewer to query for details relevant to the overall interpretation while maintaining relevant context.
The focus-plus-context principle lets us create more reliable visualizations by overlaying important details onto initial views.
Papers:
Packages: phylobar is on Bioconductor and distortions is on pypi
The RMetric algorithm [12,13] quantifies distortion geometrically. To motivate the algorithm, consider the distortion induced by mapping the sphere into latitude/longitude coordinates.
Parameterize points on \(\mathcal{M}\) using spherical coordinates:
\[\begin{align*} \mathbf{x}\left(p\right) = \left(\cos\varphi\cos\theta, \cos\varphi \sin\theta, \sin\varphi\right) \end{align*}\]
The associated (latitude, longitude) embedding is
\[\begin{align*} \mathbf{z}\left(p\right) = \left(\theta\left(p\right), \varphi\left(p\right)\right). \end{align*}\]
What does a small step in the embedding space correspond to in \(\mathcal{M}\)? The pushforward metric answers this,
\[\begin{align*} g_{ij} = \left\langle \frac{\partial\mathbf{x}}{\partial z^i}, \frac{\partial\mathbf{x}}{\partial z^j}\right\rangle_{\mathbb{R}^3} \end{align*}\]
This varies across \(p \in \mathcal{M}\) but we suppress it from the notation.
In the sphere example, these derivatives can be directly computed and to obtain,
\[\begin{align*} G = \begin{pmatrix} \cos^2\varphi & 0 \\ 0 & 1 \end{pmatrix} \end{align*}\] Near the equator (\(\varphi \approx 0\)), a small step in \(\theta\) covers more distance than near the north pole (\(\varphi \approx \frac{\pi}{2}\)).
Alternatively, the gradients \(\nabla z^i\) of the embedding dimensions also reflect distortion.
Since the level sets of \(z^\theta\) become more compressed near the poles, the gradients \(\nabla z^\theta\) become larger there.
Alternatively, the gradients \(\nabla z^i\) of the embedding dimensions also reflect distortion.
In contrast, the gradients \(\nabla z^{\varphi}\) don’t depend on \(\varphi\).
This gradient information can be stored in the matrix \(H\) with elements,
\[\begin{align*} h^{ij} = \langle \nabla z^i, \nabla z^j \rangle_{g_{0}} \end{align*}\] where \(g_{0}\) is the metric on \(\mathcal{M}\) inherited from the ambient space.
\(H\) is computable from data while \(G\) requires an explicit manifold parameterization.
In our running example,
\[\begin{align*} H = \begin{pmatrix} 1/\cos^2\varphi & 0 \\ 0 & 1 \end{pmatrix} \end{align*}\]
We can see that \(H = G^{-1}\) and that is actually true more generally.
For any \(f\) and \(g\), the Laplacian \(\Delta\) satisfies, \[\begin{align*} \Delta(fg) = f\,\Delta g + g\,\Delta f + 2\langle \nabla f, \nabla g \rangle_{g_{0}} \end{align*}\]
Setting \(f = z^i\), \(g = z^j\) and rearranging, \[\begin{align*} h^{ij} = \langle \nabla z^i, \nabla z^j \rangle_{g_0} = \frac{1}{2}\left[\Delta(z^i z^j) - z^i\Delta z^j - z^j\Delta z^i\right] \end{align*}\]
Since there are methods for estimating \(\Delta\) from data [16,17], we also have a practical method for approximating local distortions \(H\)!
To compute \(L\), we use the estimator from [17].
Build the kernel matrix \(W_{kl} = \exp(-\|X_k - X_l\|^2 / h)\), where \(h\) is a bandwidth hyperparameter.
Normalize both columns and rows. \[\begin{align*} D &= \text{diag}(W\mathbf{1}) \qquad \tilde{W} = D^{-1}WD^{-1} \\ \tilde{D} &= \text{diag}(\tilde{W}\mathbf{1}) \qquad L = \tilde{D}^{-1}\tilde{W} \end{align*}\] Column normalization accounts for differences in sampling density.
First note that, \[\begin{align*} \frac{\partial\mathbf{x}}{\partial \theta} = \left(-\cos\varphi\sin\theta, \cos\varphi\cos\theta, 0\right). \end{align*}\] Therefore, \[\begin{align*} g_{11} &= \left\langle \frac{\partial\mathbf{x}}{\partial \theta}, \frac{\partial\mathbf{x}}{\partial \theta}\right\rangle_{\mathbb{R}^3} \\ &= \cos^2\varphi\sin^2\theta + \cos^2\varphi\cos^2\theta \\ &= \cos^2\varphi \end{align*}\]
By the product formula with \(z^1 = \theta\): \[\begin{align*} h^{11} = \langle \nabla \theta, \nabla \theta \rangle_{g_0} = \frac{1}{2}\left[\Delta(\theta^2) - 2\theta\Delta\theta\right] \end{align*}\]
The general formula for the Laplace-Beltrami operator is \[\Delta f = \frac{1}{\sqrt{\det G}}\sum_{i,j}\frac{\partial}{\partial z^i}\left(\sqrt{\det G}\, g^{ij}\frac{\partial f}{\partial z^j}\right).\]
Since \(\det(G) = \cos^2\varphi\) and the off-diagonal \(g^{ij}\) are zero, \[\begin{align*} \Delta f = \frac{1}{\cos^2\varphi}\frac{\partial^2 f}{\partial\theta^2} + \frac{1}{\cos\varphi}\frac{\partial}{\partial\varphi}\left(\cos\varphi\frac{\partial f}{\partial\varphi}\right) \end{align*}\]
We can plug in the choices of \(f\) that we care about, \[\begin{align*} \Delta\theta &= 0\\ \Delta(\theta^2) &= \frac{1}{\cos^2\varphi}\frac{\partial^2(\theta^2)}{\partial\theta^2} = \frac{2}{\cos^2\varphi} \end{align*}\]
and then substitute into the formula from 2 slides ago, \[\begin{align*} h^{11} = \frac{1}{2}\left[\frac{2}{\cos^2\varphi} - 2\theta \cdot 0\right] = \frac{1}{\cos^2\varphi}. \end{align*}\]
Let \(z_{k} \in \mathbb{R}^{N}\) be the \(k^{th}\) embedding dimension. Let \(L\) be the doubly-normalized graph Laplacian [17]. Compute
\[\begin{align*} H_{kk'}^{(\cdot)} := \frac{1}{2}\left[L\left(z_{k} \circ z_{k'}\right) - z_{k} \circ \left(L z_{k'}\right) - z_{k'} \circ \left(L z_{k}\right) \right] \in \mathbb{R}^{N} \end{align*}\]
The embedding distortion for sample \(n\) is given by \(H^{(n)} \in \mathbb{R}^{K \times K}\)
For a \(K\)-dimensional embedding map, it returns a collection of matrices \(H_{n} \in \mathbb{R}^{K \times K}\) showing how each dimension is dilated or compressed.
For a \(K\)-dimensional embedding map, it returns a collection of matrices \(H_{n} \in \mathbb{R}^{K \times K}\) showing how each dimension is dilated or compressed.
In this neighborhood, \(H_{n} \approx \begin{pmatrix} 0.5 & 0 \\ 0 & 0.5 \end{pmatrix}\).
For a \(K\)-dimensional embedding map, it returns a collection of matrices \(H_{n} \in \mathbb{R}^{K \times K}\) showing how each dimension is dilated or compressed.
In this neighborhood \(H_{n} \approx \begin{pmatrix} 2 & 0 \\ 0 & 0.5 \end{pmatrix}\).
For a \(K\)-dimensional embedding map, it returns a collection of matrices \(H_{n} \in \mathbb{R}^{K \times K}\) showing how each dimension is dilated or compressed.
In this neighborhood, \(H_{n} \approx \begin{pmatrix} 0.7 & 0.2 \\ 0.2 & 0.6 \end{pmatrix}\).
There are two classic challenges in interactive interfaces [18],
These challenges also apply to interactive data analysis.
There are two classic challenges in interactive interfaces [18],
These challenges also apply to interactive data analysis.
The stability-based algorithm [8] gives a similar interpretation. But the visual encoding is more subtle, and the leave-one-out approach is time consuming even with approximations.
We can use a search bar to look up groups we care about in advance.