kdeplot

How to extract xvalues and yvalues from a kdeplot

How to extract xvalues and yvalues from a kdeplot Question: 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): …

Total answers: 1

How to change colors of a variable in a kdeplot or scatterplot

How to change colors of a variable in a kdeplot or scatterplot Question: From this dataframe that represent the position of a fish according to different months: X Y Month 2040 2760 1 2041 2580 1 2045 2762 1 2047 2763 2 2053 2774 3 and through this seaborn script: fig,ax=plt.subplots() kde = sns.kdeplot(data=HR25, x=’X’, …

Total answers: 1

How can I disable the gradient color with kdeplot?

How can I disable the gradient color with kdeplot? Question: When I run the below code, I get a figure with gradient color (from black to orange). Please look at the attached figure. Whereas I want to get a figure only with single color, orange (not figure with a gradient color). How can I do …

Total answers: 1

could not convert string to float with sns.kdeplot

could not convert string to float with sns.kdeplot Question: I am trying to use sns.kdeplotto get a figure but I get the below error: ValueError: could not convert string to float: ‘ 0.43082 0.45386’ Do you know how I can fix this error? Code snippet: data=pd.read_csv(‘input.txt’, sep="t", header = None) sns.kdeplot(data=data, common_norm=False, palette=(‘b’)) input.txt: 0.43082 …

Total answers: 1

How to fill intervals under KDE curve with different colors

How to fill intervals under KDE curve with different colors Question: I am looking for a way to color the intervals below the curve with different colors; on the interval x < 0, I would like to fill the area under the curve with one color and on the interval x >= 0 with another …

Total answers: 1

How to highlight kdeplot in average points?

How to highlight kdeplot in average points? Question: I have a problem statement to draw graphs on 5 CSV files of algorithm and compare the better algorithm among them The csv file contains only floating point numbers of 100 rows * 4 columns I have plotted the kdeplot comparing the 1st column of 5 csv …

Total answers: 1

How to set a different linestyle for each hue group in a kdeplot / displot

How to set a different linestyle for each hue group in a kdeplot / displot Question: How can each hue group of a seaborn.kdeplot, or seaborn.displot with kind=’kde’ be given a different linestyle? Both axes-level and figure-level options will accept a str for linestyle/ls, which applies to all hue groups. import seaborn as sns import …

Total answers: 1

Color the background in a kdeplot

Color the background in a kdeplot Question: I am using seaborn kernel density estimation to plot probability density contours like so: import numpy as np import seaborn as sns import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable x = np.random.normal(0, 3, 100) y = np.random.normal(0, 1, 100) fig, ax = plt.subplots() ax.scatter(x,y, marker=’.’) ax.set_aspect(‘equal’) ax.set(xlim=(-13,13)) …

Total answers: 1

Hiding values next to seaborn colormap

Hiding values next to seaborn colormap Question: Here’s a picture of the plot I get for a bivariate density. However the numbers next to the colorbar are really not of much use here, and I would like either to delete them or replace by ‘LOW’ and ‘HIGH’. I didn’t find any way of doing this …

Total answers: 1

How to change legend position in kdeplot

How to change legend position in kdeplot Question: I try to change kdeplot legend position. unfortunelly position is changed but contents is not showing. outline only. My code is: import pandas as pd import seaborn as sns import matplotlib.pyplot as plt df=pd.read_excel(‘mydata.xlsx’,sheet_name=0) ax=sns.kdeplot(data=df,x="c",hue="scan",shade=True,palette="deep",legend=False) ax.legend(loc=’upper left’, bbox_to_anchor=(0.25, 0.75)) plt.show() anboy help me~ Asked By: justice V …

Total answers: 1