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.2.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.2-py3-none-any.whl
(32.9 kB
view details)
File details
Details for the file legendkit-0.5.2.tar.gz.
File metadata
- Download URL: legendkit-0.5.2.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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 |
cb4f4c11f678b2af25f037a675c1f21120f7d160efb6f52ce1378a1906ef159c
|
|
| MD5 |
7c316d28422a4efa7ed9fbda1027e819
|
|
| BLAKE2b-256 |
8f29a788c90ff1200444b487679507e93e5ad0c07783d34d93e1139ffc2d653a
|
File details
Details for the file legendkit-0.5.2-py3-none-any.whl.
File metadata
- Download URL: legendkit-0.5.2-py3-none-any.whl
- Upload date:
- Size: 32.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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 |
b3c547a1b84256e26d054740eac2fdafe128a1c8dd6bbbf363dbe3c2c2ba2f89
|
|
| MD5 |
60a66311e47ce9d53a25f162dd1c81e1
|
|
| BLAKE2b-256 |
34465b510d4452c1ba3c3935090263df7aad3367367a715a98806100d61b758a
|