-
-
Save jaradc/82527db386e9937a99eea82e2e13dac7 to your computer and use it in GitHub Desktop.
Random colormap for matplotlib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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