2016-05-06 10 views
0

私はパイソンでseabornを使ってヒストグラムを作成しており、色をカスタマイズしたいと思っています。デフォルトの設定では透明なヒストグラムが作成され、私は忠実なものにしたいと思います。どのように透明性を取り除くのですか?Seabornを使ってPythonで作成したヒストグラムから透明度を削除するにはどうすればよいですか?

私はカラーパレットを作成し、不飽和度を0に設定しようとしましたが、結果のヒストグラムの彩度は変更されませんでした。

例:

# In[1]: 

import seaborn as sns 
import matplotlib.pyplot as plt 
get_ipython().magic('matplotlib inline') 


# In[2]: 

iris = sns.load_dataset("iris") 


# In[3]: 

myColors = ['#115e67','#f4633a','#ffd757','#4da2e8','#cfe5e5'] 
sns.palplot(sns.color_palette(myColors)) 


# In[4]: 

sns.set_palette(palette=myColors,desat=0) 


# In[5]: 

sns.set(style="white") 


# In[6]: 

sns.despine() 


# In[7]: 

plt.title('Distribution of Petal Length') 
sns.distplot(iris.petal_length, axlabel = 'Petal Length') 

Distribution of petal length

答えて

1
sns.distplot(iris.petal_length, axlabel = 'Petal Length', hist_kws=dict(alpha=1)) 
関連する問題