0
0
Pandasdata~10 mins

Plot customization (title, labels, figsize) in Pandas - Interactive Code Practice

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

Complete the code to set the plot title to 'Sales Data'.

Pandas
df.plot()
plt.[1]('Sales Data')
plt.show()
Drag options to blanks, or click blank then click option'
Atitle
Bxlabel
Cylabel
Dlegend
Attempts:
3 left
💡 Hint
Common Mistakes
Using plt.xlabel instead of plt.title
Forgetting to call plt.show() to display the plot
2fill in blank
medium

Complete the code to label the x-axis as 'Month'.

Pandas
df.plot()
plt.[1]('Month')
plt.show()
Drag options to blanks, or click blank then click option'
Agrid
Btitle
Cxlabel
Dylabel
Attempts:
3 left
💡 Hint
Common Mistakes
Using plt.ylabel instead of plt.xlabel
Not labeling the axis at all
3fill in blank
hard

Fix the error in the code to set the figure size to 10 by 5 inches.

Pandas
df.plot(figsize=[1])
plt.show()
Drag options to blanks, or click blank then click option'
A[10, 5]
B(10, 5)
C{10, 5}
D10, 5
Attempts:
3 left
💡 Hint
Common Mistakes
Using list or set instead of tuple for figsize
Passing two separate numbers without parentheses
4fill in blank
hard

Fill both blanks to set the plot title to 'Revenue' and y-axis label to 'Amount'.

Pandas
df.plot()
plt.[1]('Revenue')
plt.[2]('Amount')
plt.show()
Drag options to blanks, or click blank then click option'
Atitle
Bxlabel
Cylabel
Dlegend
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up xlabel and ylabel
Using legend instead of labels
5fill in blank
hard

Fill all three blanks to set figure size to (8,4), title to 'Profit', and x-axis label to 'Quarter'.

Pandas
df.plot(figsize=[1])
plt.[2]('Profit')
plt.[3]('Quarter')
plt.show()
Drag options to blanks, or click blank then click option'
A[8, 4]
Btitle
Cxlabel
D(8, 4)
Attempts:
3 left
💡 Hint
Common Mistakes
Using list instead of tuple for figsize
Swapping xlabel and title functions