0
0
Matplotlibdata~10 mins

Customizing Seaborn plots with Matplotlib - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the seaborn library as sns.

Matplotlib
import [1] as sns
Drag options to blanks, or click blank then click option'
Aseaborn
Bmatplotlib
Cpandas
Dnumpy
Attempts:
3 left
💡 Hint
Common Mistakes
Importing matplotlib as sns
Importing pandas or numpy instead of seaborn
2fill in blank
medium

Complete the code to create a seaborn scatter plot using the 'tips' dataset.

Matplotlib
sns.scatterplot(data=tips, x='total_bill', y=[1])
Drag options to blanks, or click blank then click option'
A'size'
B'time'
C'day'
D'tip'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'size' or 'day' which are not numeric for y-axis
Using 'time' which is categorical
3fill in blank
hard

Fix the error in the code to set the plot title using Matplotlib.

Matplotlib
plt.[1]('Scatter plot of Total Bill vs Tip')
Drag options to blanks, or click blank then click option'
Axlabel
Blegend
Ctitle
Dylabel
Attempts:
3 left
💡 Hint
Common Mistakes
Using plt.xlabel or plt.ylabel instead of plt.title
Using plt.legend which is for legends
4fill in blank
hard

Fill both blanks to change the x-axis label and y-axis label using Matplotlib.

Matplotlib
plt.xlabel([1])
plt.ylabel([2])
Drag options to blanks, or click blank then click option'
A'Total Bill ($)'
B'Tip ($)'
C'Total Bill'
D'Tip Amount'
Attempts:
3 left
💡 Hint
Common Mistakes
Using labels without quotes
Mixing up x and y labels
5fill in blank
hard

Fill all three blanks to customize the plot: set figure size, add grid, and show the plot.

Matplotlib
plt.figure(figsize=[1])
plt.grid([2])
plt.[3]()
Drag options to blanks, or click blank then click option'
A(8, 6)
BTrue
Cshow
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Passing grid as string instead of boolean
Forgetting plt.show() to display plot
Using incorrect figure size format