https://github.com/johngoertz/vsup
Value-Suppressing Uncertainty Palettes
https://github.com/johngoertz/vsup
color-palette color-scheme data-visualization dataviz uncertainty uncertainty-visualisation
Last synced: 19 days ago
JSON representation
Value-Suppressing Uncertainty Palettes
- Host: GitHub
- URL: https://github.com/johngoertz/vsup
- Owner: JohnGoertz
- Created: 2025-05-15T13:30:08.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-07-04T16:13:37.000Z (7 months ago)
- Last Synced: 2025-11-28T16:58:40.634Z (2 months ago)
- Topics: color-palette, color-scheme, data-visualization, dataviz, uncertainty, uncertainty-visualisation
- Language: Python
- Homepage: http://johngoertz.github.io/vsup
- Size: 1.69 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VSUP: Value-Suppressing Uncertainty Palettes
A Python package for visualizing data with uncertainty using Value-Suppressing Uncertainty Palettes (VSUPs). Inspired by https://github.com/uwdata/vsup.
## Installation
```bash
pip install vsup
```
### Development
The project is developed with [uv](https://docs.astral.sh/uv/).
To check for a local python environment, run:
```bash
uv run python
```
Also install the [pre-commit](https://pre-commit.com/) hooks with:
```bash
uv tool install pre-commit
pre-commit install
```
## Usage
```python
from vsup import VSUP
import numpy as np
import matplotlib.pyplot as plt
# Create a grid of values and uncertainties for better visualization
n_points = 50
step = 1 / n_points
values = np.linspace(step / 2, 1 - step / 2, n_points)
uncertainties = np.linspace(step / 2, 1 - step / 2, n_points)
# Create a 2D grid
values, uncertainties = np.meshgrid(values, uncertainties)
# Colorize the data
axs = plt.subplots(3, 3, figsize=(9, 9))[1]
for row, quantization in zip(axs, [None, "linear", "tree"]):
for ax, mode in zip(row, ["us", "ul", "usl"]):
vsup = VSUP(palette="flare", mode=mode, quantization=quantization)
colors = vsup(values, uncertainties)
ax.pcolormesh(values, uncertainties, colors)
# ax.set_title(f"{mode}") #\n({description})")
ax.set_xlabel("Value")
ax.set_ylabel("Uncertainty")
```

## Features
- Three visualization modes:
- USL: Uncertainty mapped to Saturation (chroma) and Lightness
- US: Uncertainty mapped to Saturation
- UL: Uncertainty mapped to Lightness
- Two quantization mods:
- Linear: independent binning of values and uncertainties
- Tree: value bins depend on uncertainty bin: lower uncertainty, higher value resolution
- Support for any matplotlib and seaborn colormaps
## Citation
If you use this package in your research, please cite the original VSUP paper:
```
@inproceedings{2018-uncertainty-palettes,
title = {Value-Suppressing Uncertainty Palettes},
author = {Michael Correll AND Dominik Moritz AND Jeffrey Heer},
booktitle = {ACM Human Factors in Computing Systems (CHI)},
year = {2018},
url = {http://idl.cs.washington.edu/papers/uncertainty-palettes},
}
```
## License
MIT License