简体   繁体   English

Seaborn 没有显示完整的情节

[英]Seaborn not showing full plot

I am trying to plot the "Tips" dataset from the Seaborn library, but when doing so I am only getting the dark background of the chart.我试图从 Seaborn 库中绘制“提示”数据集,但这样做时我只能得到图表的深色背景。 The actual scatter plot and histogram along the edges are not showing.沿边缘的实际散点图和直方图未显示。

I am running the code inside Spyder from the Anaconda distribution.我正在 Anaconda 发行版中的 Spyder 中运行代码。

Where am I going wrong?我哪里错了?

import seaborn as sns
import matplotlib as plt

sns.set(style="darkgrid", color_codes=True)


#Import data
tips = sns.load_dataset('tips')
tips.head()

sns.jointplot(x='total_bill', y='tip', data='tips')
plt.show()

here data="tips" is not a string这里data="tips"不是string

so you need to change the following line:所以你需要更改以下行:

sns.jointplot(x='total_bill', y='tip', data=tips)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM