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.5.0.tar.gz (28.7 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.5.0-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: legendkit-0.5.0.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.5.0.tar.gz
Algorithm Hash digest
SHA256 2d413e234d7208d8658f66dbdbb18a814bdcaab18ec90d32fde209b9658b10d5
MD5 aa46898c43d845370205244288a15711
BLAKE2b-256 188856cf752f690dcaa9d5224e77a9641e47eba9dde87ff7ba291e40dc7a7930

See more details on using hashes here.

File details

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

File metadata

  • Download URL: legendkit-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a72fc4514e9aa33fb5c2057d897783685fe970bcf62407bf2e4ceedd52f9936
MD5 84bfd1242d56ee0ffe02f80714b2e221
BLAKE2b-256 74bedc99b431346b2d2372bbe3ea7272c2b8957dd46b6ccebd0426d66dbfc9a8

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