When you want to create or adjust the legend in matplotlib, things can get dirty. Legendkit may solve your headache.
Features
- Easy title placement and alignment
- Easy colorbar with shape
- Layout for multiple legends and colorbar*
Installation
pip install legendkit
Quickstart
import numpy as np
import matplotlib.pyplot as plt
from legendkit import cat_legend, colorbar, vstack
fig, ax = plt.subplots()
data = np.random.rand(10, 10)
mappable = ax.pcolormesh(data, cmap="RdBu")
# Categorical legend
leg = cat_legend(ax, colors=["#e63946", "#457b9d", "#2a9d8f"],
labels=["Group A", "Group B", "Group C"], title="Groups")
# Colorbar placed outside axes
colorbar(mappable, ax=ax, title="Value")
plt.show()
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
legendkit-0.5.1.tar.gz
(28.8 kB
view details)
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
legendkit-0.5.1-py3-none-any.whl
(35.4 kB
view details)
File details
Details for the file legendkit-0.5.1.tar.gz.
File metadata
- Download URL: legendkit-0.5.1.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69d73b52d43427127964ca9ea868a3c50bfcaf0154575c79bea9a81028fe2818
|
|
| MD5 |
dc182d3fe303d80c122f4964a3c00c13
|
|
| BLAKE2b-256 |
535d97256f0f2a951cd89fe7d3826eedf3216052c9d6b5b19860a25ee13dce1c
|
File details
Details for the file legendkit-0.5.1-py3-none-any.whl.
File metadata
- Download URL: legendkit-0.5.1-py3-none-any.whl
- Upload date:
- Size: 35.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fed8172b1a7a7d2c593f56f360ee20b466621547634c6b9a0b7cc535d5d370db
|
|
| MD5 |
85a29323d5eb97e1a4302fbcf3e6ceec
|
|
| BLAKE2b-256 |
8fffc5d6342da7f8d552499c740a1a7e552fed6c775c7d3aa04e1980e681dfd8
|