2015-06-26 54 views
31

我想繪製使用seaborn(python)的ROC曲線。 隨着matplotlib我簡單地使用功能plot使用seaborn的簡單線條圖

plt.plot(one_minus_specificity, sensitivity, 'bs--') 

其中one_minus_specificitysensitivity配對值的兩個列表。

有沒有一個簡單的對應函數在seaborn中的陰謀功能?我看了一下畫廊,但沒有找到任何簡單的方法。

+1

爲什麼不直接matplotlib使用? Seaborn也在引擎蓋下使用matplotlib。 – hitzg

+24

因爲海豹的地塊更好 –

回答

51

由於seaborn也使用matplotlib來繪圖,因此您可以輕鬆地將兩者結合起來。如果你只是想採取seaborn的造型的set_style功能應該讓你開始:

import matplotlib.pyplot as plt 
import numpy as np 
import seaborn as sns 

sns.set_style("darkgrid") 
plt.plot(np.cumsum(np.random.randn(1000,1))) 
plt.show() 

結果:

enter image description here