Reputation: 2156
I am wanting to create a heatmap with dark purple as shown below:
Code:
import numpy as np
import seaborn as sns
np.random.seed(0)
uniform_data1 = np.random.rand(10, 12)
ax1 = sns.heatmap(uniform_data1, cbar_kws={'label': 'score1'}, cmap="BuPu")
I have tried cmap
equal to "BuPu"
, "PuBu"
or "Purples"
but all didn't quite give me the right colour. Would really be nice if I could have the same purple colours as shown in the picture above.
Many thanks in advance.
Upvotes: 0
Views: 789
Reputation: 56
import numpy as np
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
np.random.seed(0)
uniform_data1 = np.random.rand(10, 12)
fig, ax1 = plt.subplots()
ax1 = sns.heatmap(uniform_data1, cbar_kws={'label': 'score1'}, cmap=sns.cubehelix_palette(8))
plt.show()
I am not sure if sns.cubehelix_palette(8)
is exact what you desire. You could look at seaborn's choosing color palettes page to find more options.
Upvotes: 2
Reputation: 10545
I think this is what you are looking for:
cmap=sns.cubehelix_palette()
Upvotes: 1