使用seaborn的简单线条图 [英] Simple line plots using seaborn
问题描述
我正在尝试使用seaborn(python)绘制ROC曲线.使用matplotlib,我只需使用函数 plot
:
I'm trying to plot a ROC curve using seaborn (python).
With matplotlib I simply use the function plot
:
plt.plot(one_minus_specificity, sensitivity, 'bs--')
其中 one_minus_specificity
和 sensitive
是两个配对值列表.
where one_minus_specificity
and sensitivity
are two lists of paired values.
seaborn 中是否有简单的 plot 函数对应物?我看了看画廊,但没有找到任何简单的方法.
Is there a simple counterparts of the plot function in seaborn? I had a look at the gallery but I didn't find any straightforward method.
推荐答案
由于 seaborn 也使用 matplotlib 进行绘图,因此您可以轻松地将两者结合起来.如果您只想采用seaborn的样式,请
Since seaborn also uses matplotlib to do its plotting you can easily combine the two. If you only want to adopt the styling of seaborn the set_style
function should get you started:
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()
结果:
这篇关于使用seaborn的简单线条图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!