Skip to main content

Legend creation and manipulation with ease for matplotlib

Project description

Documentation Status pypi version

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()

Project details


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.4.1.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

legendkit-0.4.1-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file legendkit-0.4.1.tar.gz.

File metadata

  • Download URL: legendkit-0.4.1.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","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 legendkit-0.4.1.tar.gz
Algorithm Hash digest
SHA256 c0bfaad46d3560d212f4a241b0898861ed213e03b01155efb3a18f53d25bf836
MD5 b2022c7821cbf98be90f4597e966e7c2
BLAKE2b-256 13dba99f1339c37497f411023a94757690b5a949b0aced62a8cf2ca11175fe11

See more details on using hashes here.

File details

Details for the file legendkit-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: legendkit-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","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 legendkit-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dede1ba9f3c796476a91ac37d89aec7892b02b54491e8ae9bc60a8ef0fa544e2
MD5 122ec920891894c18516fd5400f7016b
BLAKE2b-256 85e022581b77f4bfeccffeecb1a008086122dba193a12396b7f457095e6b1909

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page