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--')
where one_minus_specificity
and sensitivity
are two lists of paired values.
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.
It's possible to get this done using
seaborn.lineplot()
but it involves some additional work of converting numpy arrays to pandas dataframe. Here's a complete example:And we get the following plot:
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:Result:
Yes, you can do the same in Seaborn directly. This is done with tsplot() which allows either a single array as input, or two arrays where the other is 'time' i.e. x-axis.