Skip to content

Instantly share code, notes, and snippets.

View jonnyhtw's full-sized avatar
💭
eating cheese

Jonny Williams jonnyhtw

💭
eating cheese
  • Reading Uni
  • Reading, UK
  • 08:55 (UTC -12:00)
View GitHub Profile
@jonnyhtw
jonnyhtw / discrete_cmap.py
Created July 29, 2020 01:52 — 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"""