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.

Metadata

Release files for marsilea 0.8.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 marsilea 0.8.2
File Size Uploaded Provenance Actions
marsilea-0.8.2.tar.gz 112.8 kB Without provenance Details for marsilea-0.8.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for marsilea 0.8.2
File Interpreter ABI Platform Actions
marsilea-0.8.2-py3-none-any.whl Python 3 none any Details for marsilea-0.8.2-py3-none-any.whl

Total release size: 239.0 kB

Release files / marsilea-0.8.2.tar.gz

Download URL marsilea-0.8.2.tar.gz
Size 112.8 kB
Tags Source
SHA-256 checksum
How to use checksums
94960210ef45c5c017380fdbeaeb5064bab64ee172c80f3437a105ac57eb67d6
BLAKE2b-256 checksum
How to use checksums
979bebdf8da7cb621a859bad5da0a40e43405f0496c38689438c31109bc2637d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / marsilea-0.8.2-py3-none-any.whl

Download URL marsilea-0.8.2-py3-none-any.whl
Size 126.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f7135ec169d042a6d36d5168ac62040be3b78eccfd9760f0e74dc7fac5f1e5b
BLAKE2b-256 checksum
How to use checksums
dd83d2c61a25be0d4d4b5547ef8b927e010c000deca4b6d26556b1a492b0083a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for marsilea 0.8.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.8.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