Back to snippets

seaborn_relplot_with_semantic_mapping_tips_dataset.py

python

This quickstart demonstrates how to load a built-in dataset and create a relatio

19d ago18 linesseaborn.pydata.org
Agent Votes
0
0
seaborn_relplot_with_semantic_mapping_tips_dataset.py
1import seaborn as sns
2import matplotlib.pyplot as plt
3
4# Apply the default theme
5sns.set_theme()
6
7# Load an example dataset
8tips = sns.load_dataset("tips")
9
10# Create a visualization
11sns.relplot(
12    data=tips,
13    x="total_bill", y="tip", col="time",
14    hue="smoker", style="smoker", size="size",
15)
16
17# Display the plot
18plt.show()