cubeheatmap
Publication-quality square-cell heatmaps for matplotlib
cubeheatmap renders clean, equal-sized square-cell heatmaps designed for scientific publications, reports, and presentations. Works with numpy arrays, pandas DataFrames, and any 2-D numerical data.
Features
- Square cells - every cell is a perfect square, sized automatically
- Multiple input formats -
from_matrix(),from_dataframe() - Annotations - display values inside cells with auto-contrast text
- Significance markers - overlay stars or custom symbols with
sig_mask - Grid layouts -
draw_grid()for multi-panel figures - Fully customisable - 36+ style parameters: colors, fonts, rounded corners, dark themes
- Domain presets - citation networks, software dependencies, data pipelines, web graphs, social networks
Installation
pip install cubeheatmap
Quick Start
import numpy as np
import cubeheatmap as ch
data = np.random.uniform(-4, 4, (10, 3))
hm = ch.CubeHeatmap.from_matrix(
data,
row_labels=[f"Gene_{i}" for i in range(10)],
col_labels=["Day14", "Day21", "Day40"],
)
style = ch.Style(cmap="RdBu_r", vmin=-4, vmax=4, colorbar_label="log2FC")
ax = ch.draw(hm, title="My Heatmap", style=style)
ax.figure.savefig("heatmap.png", dpi=150, bbox_inches="tight")
For presets, customization and transforms see docs/usage.md.
Gallery
| Annotated | Significance markers | Dark theme |
| Grid layout | Rounded corners | Likert survey |
| Citation network | Model benchmark | Dense microarray |
Examples
16 runnable scripts covering all features and presets - see docs/examples.md for the full list with previews.
cd examples && python generate_all.py
Citation
If you use cubeheatmap in a publication, please cite it:
APA:
dam2452. (2026). cubeheatmap: Publication-quality square-cell heatmaps for Python (Version 0.1.1). https://github.com/dam2452/cubeheatmap
BibTeX:
@software{cubeheatmap2026,
title = {cubeheatmap: Publication-quality square-cell heatmaps for Python},
author = {dam2452},
year = {2026},
version = {0.1.1},
url = {https://github.com/dam2452/cubeheatmap}
}
Contributing
Contributions are welcome! Here's how you can help:
- Bug reports - Open an issue with a minimal reproducible example
- Feature requests - Open an issue describing the use case
- Code contributions - Fork, create a feature branch, and open a pull request
- New presets - Add a new submodule under
cubeheatmap/presets/with ato_heatmap()function and an example
Development setup
git clone https://github.com/dam2452/cubeheatmap.git
cd cubeheatmap
pip install -e ".[dev]"
pytest tests/
License
This project is licensed under CC BY-NC 4.0 - Creative Commons Attribution-NonCommercial 4.0 International.
- Use it freely - for research, education, personal projects
- Cite the author - attribution required in publications and derivative works
- No commercial use - you may not sell or monetize this software
See LICENSE for full details.
Metadata
Release files for cubeheatmap 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cubeheatmap-0.1.1.tar.gz | 18.3 kB | Without provenance | Details for cubeheatmap-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cubeheatmap-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for cubeheatmap-0.1.1-py3-none-any.whl |
Total release size: 35.8 kB
Release files / cubeheatmap-0.1.1.tar.gz
| Download URL | cubeheatmap-0.1.1.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71819d4e9239ee57eca312f010a9174f6515c3b9f5b01b2471338d3bf807779b
|
|
BLAKE2b-256 checksum How to use checksums |
27a1e28cacc97ec62d8a03522a9cfcc286197cef89b46b88ecf93905a33208a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / cubeheatmap-0.1.1-py3-none-any.whl
| Download URL | cubeheatmap-0.1.1-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
355269c985a4d0fce12b2be0d7cff314d2272c710f0aa2518fe3804398157c8a
|
|
BLAKE2b-256 checksum How to use checksums |
1852d80d8613f5aec4b1e527f930c936918708e3a76f6f9c97938f0162a85eb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for cubeheatmap 0.1.1
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.