gpt4 book ai didi

python - 使用 seaborn 的简单线图

转载 作者:IT老高 更新时间:2023-10-28 20:33:02 31 4
gpt4 key购买 nike

我正在尝试使用 seaborn (python) 绘制 ROC 曲线。使用 matplotlib 我只需使用函数 plot:

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

其中 one_minus_specificitysensitivity 是两个配对值列表。

seaborn 中是否有简单的绘图功能对应物?我查看了图库,但没有找到任何简单的方法。

最佳答案

由于 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

关于python - 使用 seaborn 的简单线图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31069191/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com