0
0
Data Analysis Pythondata~10 mins

Figure and axes creation in Data Analysis Python - Interactive Code Practice

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

Complete the code to create a new figure using matplotlib.

Data Analysis Python
import matplotlib.pyplot as plt
fig = plt.[1]()
Drag options to blanks, or click blank then click option'
Aplot
Bfigure
Cshow
Dsubplot
Attempts:
3 left
💡 Hint
Common Mistakes
Using plt.plot() instead of plt.figure()
Trying to call plt.show() to create a figure
2fill in blank
medium

Complete the code to add a single axes to the figure.

Data Analysis Python
fig = plt.figure()
ax = fig.[1](111)
Drag options to blanks, or click blank then click option'
Aadd_subplot
Badd_axes
Csubplot
Dplot
Attempts:
3 left
💡 Hint
Common Mistakes
Using add_axes() with a code instead of a rectangle
Calling subplot() directly on plt instead of on fig
3fill in blank
hard

Fix the error in the code to create a figure and axes correctly.

Data Analysis Python
fig, ax = plt.[1]()
Drag options to blanks, or click blank then click option'
Afigure
Bsubplot
Csubplots
Dplot
Attempts:
3 left
💡 Hint
Common Mistakes
Using plt.figure() which returns only one object
Using plt.subplot() which returns a single axes
4fill in blank
hard

Fill both blanks to create a figure with 2 rows and 1 column of subplots.

Data Analysis Python
fig, ax = plt.[1]([2], 1)
Drag options to blanks, or click blank then click option'
Asubplots
Bfigure
C2
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using plt.figure() instead of plt.subplots()
Swapping rows and columns numbers
5fill in blank
hard

Fill all three blanks to create a figure with 3 columns and 2 rows of subplots.

Data Analysis Python
fig, ax = plt.[1]([2], [3])
Drag options to blanks, or click blank then click option'
Asubplots
B2
C3
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping rows and columns numbers
Using plt.figure() instead of plt.subplots()