Skip to content

Instantly share code, notes, and snippets.

View Zsailer's full-sized avatar

Zachary Sailer Zsailer

View GitHub Profile
@Zsailer
Zsailer / discrete_cmap.py
Created August 18, 2016 17:31 — forked from jakevdp/discrete_cmap.py
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"""