Tuesday 18 August 2020

seaborn 1 scatter plot

 import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="darkgrid")

tips = sns.load_dataset("tips")
tips.head()

total_bill tip sex smoker day time size
0 16.99 1.01 Female No Sun Dinner 2
1 10.34 1.66 Male No Sun Dinner 3
2 21.01 3.50 Male No Sun Dinner 3
3 23.68 3.31 Male No Sun Dinner 2
4 24.59 3.61 Female No Sun Dinner 4

sns.relplot(x="total_bill", y="tip", data=tips)

sns.relplot(x="total_bill", y="tip", hue="smoker", data=tips)

sns.relplot(x="total_bill", y="tip", hue="smoker", style="smoker",
            data=tips);

sns.relplot(x="total_bill", y="tip", hue="smoker", style="time", data=tips);

sns.relplot(x="total_bill", y="tip", hue="size", palette="ch:r=-.5,l=.75", data=tips);

sns.relplot(x="total_bill", y="tip", size="size", sizes=(15, 200), data=tips);

sns.relplot(x="total_bill", y="tip", size="size", sizes=(15, 200), hue="size", data=tips);

pallet

No comments:

Post a Comment