sns seaborn 画图 titanic iris dataset

​%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
np.random.seed(sum(map(ord, ‘regression’)))
tips = sns.load_dataset(‘tips’)
tips.head()

sns.regplot(x=‘total_bill’,y=‘tip’,data=tips)

titanic = sns.load_dataset(‘titanic’)
tips = sns.load_dataset(‘tips’)
sns.stripplot(x=‘day’,y=‘total_bill’,data=tips,jitter=True)
titanic = sns.load_dataset(‘titanic’)
tips = sns.load_dataset(‘tips’)
sns.stripplot(x=‘day’,y=‘total_bill’,data=tips,jitter=True)
sns.swarmplot(x=‘day’,y=‘total_bill’,data=tips)

sns.boxplot(x=‘day’,y=‘total_bill’,hue=‘time’,data=tips)

sns.barplot(x=‘sex’,y=‘survived’,hue=‘class’,data=titanic)

你可能感兴趣的:(dataprepare)