Skip to main content

Metalmaps - Heavy Metal and Classic Rock Album Art Inspired Matplotlib Colormaps

Ever wanted to make your python plots more metal? Fear not, now you can! metalmaps delivers heavy metal and classic rock album art inspired matplotlib colormaps!

Visit the gallery for a comprehensive picture.

Contents

Installation

Install this package via pip:

pip install metalmaps

Alternatively, grab the source from github.

Usage

To use these, you can import them and use them with matplotlib as you would with any other color map.

from metalmaps import black_sabbath
from matplotlib.pyplot import imshow
from numpy import random

imshow(random.rand(128, 128), cmap=black_sabbath)

The color maps can also be accessed in matplotlib using strings by prefixing metalmaps, e.g.

import metalmaps

imshow(random.rand(128, 128), cmap="metalmaps.red")

Using a colormap as default line colors in plots

It's possible to replace the default matplotlib color cycle with one provided by this package. To achieve this, call the provided metalmaps.set_color_cycle() function, and pass the colormap you want as the argument, e.g:

import metalmaps
metalmaps.set_color_cycle(metalmaps.reign_in_blood)

For example, this code

from matplotlib import pyplot as plt
import numpy as np

import metalmaps
metalmaps.set_color_cycle(metalmaps.reign_in_blood)

x = np.linspace(0, 1.4, 200)
def y(x, phi):
    return np.sin(1.2 * np.pi * (x + 0.25) - 0.1 * phi)

plt.figure()

for i in range(10):
    labelname = "C"+str(i)
    plt.plot(x, y(x, i), linewidth=5, label=labelname)

plt.legend(ncols=2)
plt.tight_layout()
plt.savefig("my_figure.png")

results in the following figure:

where we didn't have to specify the different colors each time we called plot().

Examples

This package currently includes 30 colormaps:

  • Animals (Pink Floyd)
  • The Apostasy (Behemoth)
  • Ashes of the Wake (Lamb of God)
  • Black Sabbath (Black Sabbath)
  • The Blues Brothers (The Blues Brothers)
  • Blues Pills (Blues Pills)
  • Cosmo's Factory (Creedence Clearwater Revival)
  • Deep Purple in Rock (Deep Purple)
  • The Dethalbum (Dethklok)
  • Fear of the Dark (Iron Maiden)
  • From Mars to Sirius (Gojira)
  • Hybrid Theory (Linkin Park)
  • Hypnotize (System of a Down)
  • In Utero (Nirvana)
  • L.A. Woman (The Doors)
  • L'enfant Sauvage (Gojira)
  • London Calling (The Clash)
  • Master of Puppets (Metallica)
  • Made in Japan (Deep Purple)
  • Meteora (Linkin Park)
  • The Number of the Beast (Iron Maiden)
  • obZen (Meshuggah)
  • Overkill (Motörhead)
  • Painkiller (Judas Priest)
  • Paranoid (Black Sabbath)
  • Powerslave (Iron Maiden)
  • Rage Against The Machine (Rage Against The Machine)
  • Reign in Blood (Slayer)
  • Ride the Lightning (Metallica)
  • Rock 'n' Roll (Motörhead)
  • Screaming for Vengeance (Judas Priest)
  • South of Heaven (Slayer)
  • The Hunter (Mastodon)
  • The Rise and Fall of Ziggy Stardust and the Spiders From Mars (David Bowie)
:exclamation: For a full gallery, visit https://mladenivkovic.github.io/metalmaps/metalmaps.html

Here are some examples:

Black Sabbath (Black Sabbath)

Deep Purple in Rock (Deep Purple)

From Mars To Sirius (Gojira)

Master of Puppets (Metallica)

obZen (Meshuggah)

Overkill (Motörhead)

Painkiller (Judas Priest)

Paranoid (Black Sabbath)

The Hunter (Mastodon)

Note

Of course, these aren't necessarily designed to be colorblind friendly, or perceptually uniform, so use them with caution. They are fun though. To underline how much you should not use these in a real scientific publication (apart from perhaps qualitative imaging), the lightness values are shown below.

For quantitative comparisons, please ensure that you use a perceptually uniform colour map (see e.g. those available directly through matplotlib).

Contributing

Yes please! It would be grand to collect even more album art colormaps.

Intstructions:

  • generate your color palette any way you please, and add it to colors.py
  • instantiate the matplotlib colormap in __init__.py
  • add your addition to the album lists in README.md and __init__.py
  • submit your merge request
  • ???
  • profit!

Authors, License, Credits

Credits

All of this was inspired by (and shamelessly copied from) Josh Borrow's swiftascmaps.

Image credits:

  • The "Kelvin-Helmholtz" data used in the plots below were generated using mesh-hydro.
  • The "EAGLE" data used in the plots below were obtained from the swiftsim repository.
  • The "NGC" data used in the plots below were originally obtained from flickr, credits to Judy Schmidt. I modified the image later to normalize the pixel values to be able to demonstrate the colormaps as above.

License

License: LGPLv3

Authors and Contributors

Mladen Ivkovic, Josh Borrow

Release files for metalmaps 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metalmaps 2.1.0
File Size Uploaded
metalmaps-2.1.0.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for metalmaps 2.1.0
File Interpreter ABI Platform
metalmaps-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.2 kB

Release files / metalmaps-2.1.0.tar.gz

Download URL metalmaps-2.1.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f5f5c107f55099c088e8dd406e483ed5ebe0ab1642198a961f12f4b15857bc75
BLAKE2b-256 checksum
How to use checksums
c29000204139891ba49474698f0b5f93a28681eca4edc277fa92786f1e38b58c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / metalmaps-2.1.0-py3-none-any.whl

Download URL metalmaps-2.1.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd4ca10f35bbdbf165dc5efe8ef5ad1b91a8e2b8c87a9499a32ae1b0500898d0
BLAKE2b-256 checksum
How to use checksums
ba21bef7faecccedd856b826ea473e5ecc8943765bfff492f5805b7928db9d27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.0.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page