Skip to main content

Marsilea: declarative creation of composable visualization

Documentation Status pypi version Conda Version PyPI - License DOI

Documentation | Tutorials | Gallery | llms.txt | Genome Biology

Marsilea: Declarative creation of composable visualization

Marsilea builds complex annotated heatmaps, oncoprints, UpSet plots, sequence logos and other composable visualizations in Python — declaratively, on top of Matplotlib.

Quickstart (8 lines)

import numpy as np
import marsilea as ma
import marsilea.plotter as mp

data = np.random.default_rng(0).standard_normal((10, 10))

h = ma.Heatmap(data, linewidth=0.5, height=4, width=4)
h.add_top(mp.Bar(data.mean(axis=0)), size=0.8, pad=0.1)
h.add_left(mp.Labels([f"Gene{i}" for i in range(10)]), pad=0.05)
h.add_dendrogram("right")
h.add_legends()
h.render()
Heatmap with a bar chart on top, gene labels on the left, a dendrogram on the right and a colorbar

Add a bar chart on top, labels on the left, a dendrogram on the right. Each side is just another building block. → Full tutorial

Using scanpy/scverse? Marsilea has an official how-to in the scanpy documentation: Plotting with Marsilea

Installation

PyPI

pip install marsilea

Conda

conda install -c conda-forge marsilea

Use with Agents

Marsilea ships an official agentic skill:

Claude Code

/plugin marketplace add Marsilea-viz/marsilea-skill
/plugin install marsilea@marsilea-marketplace

For other agents, simply ask the agent to install the skill for you.

Once installed, the skill activates automatically whenever you ask Claude for a composable visualization. Marsilea itself still needs to be installed in your Python environment (see above). See the marsilea-skill repository, or Use Marsilea with AI assistants for other assistants and the machine-readable llms.txt.

What is Composable Visualization?

Animation of a heatmap gaining side plots one call at a time

When we do visualization, we often need to combine multiple plots to show different aspects of the data. For example, we may need to create a heatmap to show the expression of genes in different cells, and then create a bar chart to show the expression of genes in different cell types. A visualization contains multiple plots is called a composable visualization. In Marsilea, we employ a declarative approach for user to create composable visualization incrementally.

Examples

Bar chart with images Stacked bar chart Arc diagram
Bar chart of programming language ratings with language logos as labels Cross-layout stacked bar chart of fat content in cooking oils Arc diagram of the Les Misérables character network
Single-cell RNA-seq heatmap Oncoprint UpSet plot
Annotated heatmap of marker gene expression across PBMC 3k cell types Oncoprint of breast cancer mutations across samples and genes UpSet plot of genre intersections in the IMDB top 1000 movies

More examples →

Citation

If you use Marsilea in your research, please cite the following:

Marsilea: an intuitive generalized paradigm for composable visualizations

Yimin Zheng, Zhihang Zheng, André F. Rendeiro & Edwin Cheung

Genome Biology 2025 Jan 06. DOI: 10.1186/s13059-024-03469-3

Getting help

Found a bug or have a question? Open an issue.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marsilea-0.8.1.tar.gz (110.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marsilea-0.8.1-py3-none-any.whl (123.9 kB view details)

Uploaded Python 3

File details

Details for the file marsilea-0.8.1.tar.gz.

File metadata

  • Download URL: marsilea-0.8.1.tar.gz
  • Upload date:
  • Size: 110.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for marsilea-0.8.1.tar.gz
Algorithm Hash digest
SHA256 9c717bbad18183e78bf912669b6743dfa4cfaa772687578b69af7d777dd53a61
MD5 453ed6a3461b37ac3aea2927e4d76314
BLAKE2b-256 987d9f363524e27b64c185c3f0a2d510e386980affdde56a8a37ba3992ac5554

See more details on using hashes here.

File details

Details for the file marsilea-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: marsilea-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 123.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for marsilea-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a941b5d5fd293af664b7807f399b6b72db7a6fcd40eea315aadd6f6b5753a91
MD5 767f7c6c517ee69d9ffeefa760c4335f
BLAKE2b-256 99e0f0ca9b23581803ca7f67a56b48e5f40e9dfeb6df3f6260cfc74012be3169

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 files

0.8.0

2 files

0.7.0.post1

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

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