Value-Suppressing Uncertainty Palettes for Python
Project description
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
Coming soon...
Development
The project is developed with uv.
To check for a local python environment, run:
uv run python
Also install the pre-commit hooks with:
uv tool install pre-commit
pre-commit install
Usage
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vsup-0.1.0.tar.gz.
File metadata
- Download URL: vsup-0.1.0.tar.gz
- Upload date:
- Size: 589.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0e8f9207682e2d2044b78680b8fd2394f8f94a5d1f8cccd6aee796672df88a3
|
|
| MD5 |
2e42f1a17bb40d75e2fc22d11ad324d8
|
|
| BLAKE2b-256 |
ee272dabe26cbaf61932d79e10b814ff10f5051bf49c5c4ccd00094e68c3a642
|
File details
Details for the file vsup-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vsup-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b13c0d9f009c4b3ca9599c52208166cc859525eed950bc058459ba5fd53a6925
|
|
| MD5 |
f1af9f8bb7657909fa5326442d904d81
|
|
| BLAKE2b-256 |
61675c668a2ad64490027eaef0ec5f73f13a89ca7a65df66d04fa922342e2bc3
|