0
0
Matplotlibdata~10 mins

Seaborn figure-level vs axes-level in Matplotlib - Interactive Practice

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

Complete the code to import seaborn with its common alias.

Matplotlib
import [1] as sns
Drag options to blanks, or click blank then click option'
Asb
Bsklearn
Csns
Dseaborn
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'sklearn' instead of 'seaborn'.
Using 'sb' which is not the common alias.
Trying to import 'sns' directly.
2fill in blank
medium

Complete the code to create a figure-level plot using seaborn's scatterplot function.

Matplotlib
sns.[1](data=df, x='total_bill', y='tip')
Drag options to blanks, or click blank then click option'
Ascatterplot
Bplot
Cscatter
Dscatter_plot
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'scatter' which is not a seaborn function.
Using 'plot' which is a matplotlib function.
Using 'scatter_plot' which is not a valid function.
3fill in blank
hard

Fix the error in the code to create an axes-level plot with seaborn's histplot on a given matplotlib axis.

Matplotlib
fig, ax = plt.subplots()
sns.histplot(data=df, x='total_bill', ax=[1])
Drag options to blanks, or click blank then click option'
Aax
Baxes
Cfigure
Dplot
Attempts:
3 left
💡 Hint
Common Mistakes
Passing 'figure' instead of 'ax'.
Passing 'axes' which is undefined here.
Passing 'plot' which is not a variable.
4fill in blank
hard

Fill both blanks to create a figure-level seaborn plot and then show it using matplotlib.

Matplotlib
plot = sns.[1](data=df, x='total_bill', y='tip')
plt.[2]()
Drag options to blanks, or click blank then click option'
Ascatterplot
Bshow
Chistplot
Ddraw
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'histplot' instead of 'scatterplot' for scatter plots.
Using 'draw' instead of 'show' to display the plot.
5fill in blank
hard

Fill all three blanks to create an axes-level seaborn plot on a matplotlib axis and then set the title.

Matplotlib
fig, ax = plt.subplots()
sns.[1](data=df, x='total_bill', y='tip', ax=[2])
ax.[3]('Total Bill vs Tip')
Drag options to blanks, or click blank then click option'
Ascatterplot
Bax
Cset_title
Dfigure
Attempts:
3 left
💡 Hint
Common Mistakes
Passing 'figure' instead of 'ax' to seaborn.
Using 'title' instead of 'set_title' method.
Using a figure-level function instead of axes-level.