Skip to main content

kBird colourmap is way better than viridis

Project description

kBird

kBird brings CERN's kBird colormap into matplotlib. It registers the colormap and sets it as your global default.


How to use

1. Global default in matplotlib

To use kBird, simply import the library and call set().

import kbird
kbird.set()

# All plots will use kBird instead of viridis
plt.imshow(Z) 

2. Using kBird inside a specific block

If you do not want to change your global matplotlib defaults and only want to use kBird for a single plot, you can use the style() context manager:

import kbird
import matplotlib.pyplot as plt

# Only plots generated inside this block will use kBird
with kbird.style():
    plt.imshow(Z)
    plt.show()

# Any plot out here will fall back to your standard matplotlib default
plt.imshow(Z) 

3. Manual Colormap Access

If you prefer to pass the colormap explicitly to matplotlib functions, you can import the colormap object directly:

import matplotlib.pyplot as plt
from kbird import kbird_cmap

plt.imshow(Z, cmap=kbird_cmap)

License

This project is licensed under the MIT License.

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

kbird-0.1.0.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

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

kbird-0.1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file kbird-0.1.0.tar.gz.

File metadata

  • Download URL: kbird-0.1.0.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for kbird-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0ebd9a3e2fb4c8942b0984bc2794e9d9dd1956f6eb89564fe490d3c406101782
MD5 a861832cc7866ce940be7ad86c4b1a13
BLAKE2b-256 0dd278e55cc21a53b1ddc68f3aeebbed250aaade7ec33c681b2cff2dc9060a37

See more details on using hashes here.

File details

Details for the file kbird-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kbird-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for kbird-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 614c437eb96a96dcccc5910235af9ca2f19b798db360615d0c678203240d8767
MD5 176315b2f2cf719d868cbed8f34a10f4
BLAKE2b-256 102081d15644deec29c3ee2aa4632ae575f5a792811f29eac2e2b259cc7769a1

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