Skip to content

Instantly share code, notes, and snippets.

@jaradc
Forked from jgomezdans/random.py
Last active November 30, 2017 05:56
Show Gist options
  • Save jaradc/82527db386e9937a99eea82e2e13dac7 to your computer and use it in GitHub Desktop.
Save jaradc/82527db386e9937a99eea82e2e13dac7 to your computer and use it in GitHub Desktop.
Random colormap for matplotlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
# A random colormap for matplotlib
rand_cmap = ListedColormap(np.random.rand(256,3))
for i in range(5):
plt.scatter([1,2,3], np.random.randn(3), s=10, cmap=rand_cmap)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment