Matplot Lib MCQs with answers Page - 11

Here, you will find a collection of MCQ questions on Matplot Lib. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 831.35K Points
Coach

Q. How do you export a figure with padding?

  • (A) plt.export(pad=True)
  • (B) plt.savefig(..., bbox_inches='tight')
  • (C) plt.tight_padding()
  • (D) plt.figure(pad=True)

A

Admin • 831.35K Points
Coach

Q. Which parameter of `plt.scatter()` maps color to values?

  • (A) marker
  • (B) c
  • (C) color_map
  • (D) value

A

Admin • 831.35K Points
Coach

Q. Which function plots time series from a DataFrame?

  • (A) df.plot_timeseries()
  • (B) plt.plot_date()
  • (C) df.plot() with datetime index
  • (D) df.timeplot()

A

Admin • 831.35K Points
Coach

Q. How do you enable a grid only on y-axis?

  • (A) plt.grid(axis='y')
  • (B) plt.grid(y=True)
  • (C) plt.grid(only='y')
  • (D) plt.ygrid()

A

Admin • 831.35K Points
Coach

Q. What happens if you run `plt.plot([1,2],[3,4])` twice before `plt.show()`?

  • (A) Only the last plot is shown
  • (B) Both lines are plotted on the same figure
  • (C) An error occurs
  • (D) Only one line is plotted

A

Admin • 831.35K Points
Coach

Q. What is returned by `plt.subplots(nrows=1, ncols=2)`?

  • (A) One figure and one axis
  • (B) Two separate figures
  • (C) A tuple (figure, array of axes)
  • (D) None of the above

A

Admin • 831.35K Points
Coach

Q. Which option is used for bar chart width?

  • (A) linewidth
  • (B) barwidth
  • (C) width
  • (D) size

A

Admin • 831.35K Points
Coach

Q. What happens if x and y passed to `plt.plot(x, y)` have different lengths?

  • (A) It works normally
  • (B) Raises a ValueError
  • (C) Only part of the plot is drawn
  • (D) The shorter list is padded with zeros

A

Admin • 831.35K Points
Coach

Q. How to display the plot inline in Jupyter Notebook?

  • (A) %inline
  • (B) %plot
  • (C) %matplotlib inline
  • (D) %show plot

A

Admin • 831.35K Points
Coach

Q. Which library extends Matplotlib with high-level statistical plots?

  • (A) NumPy
  • (B) Plotly
  • (C) Seaborn
  • (D) SciPy

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ