我正在尝试使用seaborn(python)绘制ROC曲线。
对于 matplotlib,我只需使用该函数plot
:
plt.plot(one_minus_specificity, sensitivity, 'bs--')
where one_minus_specificity
and sensitivity
是两个配对值列表。
seaborn中有一个简单的plot函数吗?我浏览了画廊,但没有找到任何简单的方法。
由于seaborn还使用matplotlib来进行绘图,因此您可以轻松地将两者结合起来。如果你只想采用seaborn的风格set_style http://stanford.edu/~mwaskom/software/seaborn/tutorial/aesthetics.html#styling-figures-with-axes-style-and-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()
Result:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)