alyssaeliyah
alyssaeliyah

Reputation: 2244

Python - Display Seaborn KDE Plot

I want to display Seaborn KDE Plot but I couldn't get to display it with a normal show method. How shall I do it?

import numpy as np 
from scipy.fftpack import dct
import seaborn 

sample1 = dct(np.random.rand(100))
sample2 = dct(np.random.rand(30))
seaborn.kdeplot(sample1, color="r")
seaborn.kdeplot(sample2, color="b")

Upvotes: 0

Views: 543

Answers (1)

abhilb
abhilb

Reputation: 5757

Try

import numpy as np 
from scipy.fftpack import dct
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()

sample1 = dct(np.random.rand(100))
sample2 = dct(np.random.rand(30))
sns.kdeplot(sample1, color="r")
sns.kdeplot(sample2, color="b")
plt.show()

Output enter image description here

Upvotes: 1

Related Questions