Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
496 views
in Technique[技术] by (71.8m points)

python - Seaborn: Violin Plot does not show show anything when trying to plot it with the Y Axis Mean

I am trying to plot a seaborn.violinplot , which shows the .mean on the y-axis, but when I try to plot it, nothing shows up on my plot for some reason.

This the code I am using:

fig, ax = plt.subplots(figsize=(15,10))
sns.catplot(x="Day", y=df[['Time']].mean(), hue="Smoker",
               data=df, kind="violin")

As you can see in my code, I am trying to plot the .mean of the Time attribute in my plot, which should show in the y-axis.

Any help on how to achieve this, including what I am doing wrong, is much appreciated.

Thank you for you time.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...