Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13951

How to extract xvalues and yvalues from a kdeplot

$
0
0

Given that I have a seaborn.kdeplot I want to extract the x and y points. Based on similar questions I have tried the following:

points = sns.kdeplot(targets, shade=True, label='train').get_lines()[0].get_data()x      = points[0]y      = points[1]

But I'm getting the error

Traceback (most recent call last):  File "<string>", line 10, in <module>IndexError: list index out of range

I'm using seaborn==0.12.2 and matplotlib==3.7.1


Viewing all articles
Browse latest Browse all 13951

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>