Skip to main contentSkip to solution

Which of the following is not a valid plotting function in pyplot?

Solution

✅ Correct Option: 4

pyplot has no function called line(). Line graphs are drawn with plot(), for example plt.plot(x,y)plt.plot(x, y), so line() is not a valid plotting function.

scatter() makes scatter plots, barh() makes horizontal bar charts and boxplot() makes box-and-whisker plots, so these three do exist in pyplot.

The word "line" appears only in names such as axhline() and axvline(), which draw horizontal and vertical reference lines.

Keyboard Shortcuts

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