Skip to main contentSkip to solution

Which of the following are components of a plot?

(A) Legend

(B) Ticks

(C) Title

(D) xlabel

Solution

✅ Correct Option: 3

All four are components of a plot. A legend explains what each line or marker represents, ticks mark the values along the axes, the title names the plot, and the xlabel describes what the x-axis shows.

In Matplotlib, these are added with plt.legend(), plt.xticks(), plt.title() and plt.xlabel().

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question