Tips Dataset in Seaborn


This entry is part 2 of 3 in the series Seaborn

The seaborn library of Python has a built-in dataset that a data professional can easily use to learn their data presentation craft. I created a project called Tips Dataset in Seaborn in Jupyter Notebook.

You can get the scatterplot for the tips dataset over here.

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
tips = sns.load_dataset("tips")
tips.head()

Here below is the screenshot of what that looks like.

plt.figure(figsize =(3, 3))
sns.scatterplot(data=tips, x="total_bill", y="tip", hue="time", alpha=0.5)
# notice that the legend is done automatically for us

Click to Enlarge

plt.figure(figsize =(4, 4))
sns.scatterplot(data=tips, x="total_bill", y="tip", hue="day", style="time")

Seaborn Style and Color

At the seaborn website there is an article called Controlling Figure Aesthetics. There is another article called Choosing Color Palettes.

The geeksforgeeks.org website covers style and color in seaborn and it uses the Tips dataset to illustrate some features. The article is called Seaborn | Style And Color.

Series Navigation<< Seaborn IntroductionSeaborn Style and Color >>

Leave a Reply