简体   繁体   中英

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. The actual scatter plot and histogram along the edges are not showing.

I am running the code inside Spyder from the Anaconda distribution.

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

so you need to change the following line:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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