Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Bar Plots: Hue | Data Visualization
Gaining Insights with Data Visualization

book
Bar Plots: Hue

Завдання
test

Swipe to show code editor

  1. Implement a more advanced bar plot by plotting the values of the 'day' column as the x variable and the values of the 'total_bill' as y.

Рішення

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
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 5
We use cookies to make your experience better!
some-alt