Simple line plots using seaborn

Titus Pullo picture Titus Pullo · Jun 26, 2015 · Viewed 101.7k times · Source

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.

Answer

hitzg picture hitzg · Jun 26, 2015

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()

Result:

enter image description here