Skip to main content

miso-plot

miso-plot logo

A lightweight visualization tool for clustered high-density data

PyPI License: MIT Python 3.8+ Build


Overview

miso-plot is a simple yet efficient Python library for visualizing large clustered datasets. It was designed for fast exploration of high-density 2D embeddings such as UMAP, t-SNE, or PCA outputs, using adaptive density smoothing and perceptually uniform color palettes.

Typical use cases include:

  • visual inspection of clustering quality in large datasets,
  • density-based highlighting of local data structures,
  • generation of publication-quality scatter plots.

Installation

 pip install miso-plot
 

Or install the latest development version directly from GitHub:

 pip install git+https://github.com/Aleksandra795/miso-plot.git
 

Quick Example

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from miso_plot import miso_plot

# Generate synthetic clustered data
X, labels = make_blobs(n_samples=50000, centers=6, n_features=2, random_state=42)
Y = X[:, 1]
X = X[:, 0]

# Plot simple scatterplot of the data
plt.figure()
plt.scatter(X, Y, s=10, c=labels, alpha=0.5, cmap='tab10')
plt.xlabel("x")
plt.ylabel("y")
plt.title("simple scatter plot")
plt.grid(True)
plt.show()
  

Example scatter plot

Because often the clusters overlap substantially, identifying their true centers is challenging. miso-plot facilitates this process by visualizing each cluster’s density distribution, highlighting regions representing the top m fraction of its overall density.

# Show cluster density centers with miso-plot
fig, ax = plt.subplots()
plt.scatter(X, Y, s=10, c='#D6D6D6', alpha=0.5)
miso_plot(X, Y, labels, cmap="tab10", m=0.5, ax=ax)  
plt.xlabel("x")
plt.ylabel("y")
plt.title("mISO plot, m=0.5")
plt.grid(True)
plt.show()
 

Example miso plot

The usefulness of miso-plot is best illustrated using real experimental data. Below is an example based on single-cell mass cytometry data from Samusik et al. (2016) — “Automated mapping of phenotype space with single-cell data” (Nature Methods, 13, 493–496; DOI: 10.1038/nmeth.3863) — containing 24 manually annotated bone marrow cell subtypes. miso-plot clearly reveals the dominant spatial organization of these subtypes on the UMAP projection while suppressing outliers and low-density noise, making the overall cluster structure easier to interpret.

Example miso plot


API Overview

miso_plot(X, Y, labels, cmap='miso24', m=0.5, lam=20, ax=None, alpha=0.3, marker='s', size=10)

Generates a smoothed scatter plot with adaptive density highlighting.

ParameterTypeDescription
X, Ynp.ndarrayCoordinates of points
labelsnp.ndarrayCluster labels for each point
cmapstr or listColormap ('miso24', matplotlib/seaborn name, or list of hex)
mfloatDensity threshold
lamintSmoothing parameter
axmatplotlib.axes.Axes or NoneOptional existing Axes; creates a new one if None
alphafloatTransparency of points
markerstrMarker style
sizeintSize of each point

The m parameter has the strongest impact on the visual output of miso-plot. Its default value is 0.5, corresponding to the median density isoline, but it can be adjusted to control how much of the cluster density is visualized. Common choices include 0.25 (top 75% of the densest regions) and 0.75 (top 25%), depending on the desired level of detail.

m parameter


Color Palettes

Built-in palette: miso24
Designed for cluster visualization (24 clusters) with high perceptual separation.

miso24 palette

You may also pass:

  • any matplotlib/seaborn palette name (e.g. 'viridis', 'tab10'),
  • a custom list of hex colors (e.g. ['ff0000', '00ff00', '0000ff']).

Citation

If you use miso-plot or the underlying method in your research or publications, please cite:

Suwalska, A.; Polanska, J.
GMM-Based Expanded Feature Space as a Way to Extract Useful Information for Rare Cell Subtypes Identification in Single-Cell Mass Cytometry.
Int. J. Mol. Sci. 2023, 24(18), 14033.
https://doi.org/10.3390/ijms241814033
(Open Access)

License

This project is distributed under the MIT License.


Created with ❤️ and scientific curiosity.

Metadata

Release files for miso-plot 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for miso-plot 0.1.2
File Size Uploaded Provenance Actions
miso_plot-0.1.2.tar.gz 8.0 kB Without provenance Details for miso_plot-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for miso-plot 0.1.2
File Interpreter ABI Platform Actions
miso_plot-0.1.2-py3-none-any.whl Python 3 none any Details for miso_plot-0.1.2-py3-none-any.whl

Total release size: 16.1 kB

Release files / miso_plot-0.1.2.tar.gz

Download URL miso_plot-0.1.2.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
834f6447ea8997a89699e2dd81db8967ce7f5bd0b86a00c1b56e4748e313c51d
BLAKE2b-256 checksum
How to use checksums
fb56a074804c39fa48a1038676b04c783dbfd0f00144a84bffd1d966dec076d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4

Release files / miso_plot-0.1.2-py3-none-any.whl

Download URL miso_plot-0.1.2-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea7ce7e2f6c6ccdba6014a0f2cff82bce71e91f5320854c17c798367faa2a596
BLAKE2b-256 checksum
How to use checksums
e11940879c8727e46c01065e37f93327d129f915c46cc03ec6c8e24b91bf5174
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4

Security for miso-plot 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page