Created
December 9, 2015 06:00
-
-
Save Shaunakde/61d3244c983c2f91636f to your computer and use it in GitHub Desktop.
Plot a colormap for inclusion in figures using 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
def show_colormap(cmap): | |
im = np.outer(np.ones(10), np.arange(100)) | |
fig, ax = plt.subplots(1,1, figsize=(6, 1.5), | |
subplot_kw=dict(xticks=[], yticks=[])) | |
fig.subplots_adjust(hspace=0.1) | |
ax.imshow(im, cmap=cmap) | |
show_colormap('jet') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment