Bar Plots: Hue
Compito
Swipe to start coding
- Implement a more advanced bar plot by plotting the values of the
'day'
column as thex
variable and the values of the'total_bill'
asy
.
Soluzione
import seaborn as sns
import matplotlib.pyplot as plt
# Setting plot style: grey grid in the background
sns.set(style='darkgrid')
# Loading the dataset
tips = sns.load_dataset('tips')
# Setting the figure size
plt.figure(figsize=(8, 8))
# Create a bar plot
sns.barplot(x='day', y='total_bill', hue='smoker', data=tips, errorbar=None);
Mark tasks as Completed
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 5
AVAILABLE TO ULTIMATE ONLY