Created
April 25, 2024 15:40
-
-
Save kaspermunch/286b5d8f9ec8917e68dc0d47d81add6a to your computer and use it in GitHub Desktop.
custom color map
This file contains 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 matplotlib.pyplot as plt | |
import matplotlib.colors as clr | |
import numpy as np | |
some_matrix = np.random.rand(10, 10) | |
cmap = clr.LinearSegmentedColormap.from_list('custom colormap', | |
['white', 'gold', 'red', 'magenta', 'blue', 'black'], | |
N=256) | |
sns.heatmap(some_matrix, cmap=cmap) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment