Skip to content

Instantly share code, notes, and snippets.

View ionymikler's full-sized avatar

Jonathan (iony) Mikler ionymikler

View GitHub Profile
@jakevdp
jakevdp / discrete_cmap.py
Last active August 26, 2024 01:46
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""