使用seaborn的简单线条图 [英] Simple line plots using seaborn

查看:46
本文介绍了使用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_specificitysensitive 是两个配对值列表.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆