Matplot Lib MCQs with answers Page - 7

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 • 832.27K Points
Coach

Q. How do you create error bars in Matplotlib?

  • (A) plt.errorbar()
  • (B) plt.ploterror()
  • (C) plt.plot() with errors=True
  • (D) plt.errplot()

A

Admin • 832.27K Points
Coach

Q. What is the correct way to change the default style of Matplotlib?

  • (A) plt.set_style()
  • (B) plt.rcParams['style']
  • (C) plt.style.use('style_name')
  • (D) plt.change_style()

A

Admin • 832.27K Points
Coach

Q. Which style makes Matplotlib plots look similar to ggplot2 in R?

  • (A) plt.style.use('gg')
  • (B) plt.style.use('seaborn')
  • (C) plt.style.use('ggplot')
  • (D) plt.style.use('rplot')

A

Admin • 832.27K Points
Coach

Q. What is the role of 'figsize' in plt.figure()?

  • (A) Sets figure title
  • (B) Sets plot aspect ratio
  • (C) Sets the figure window size in inches
  • (D) Sets subplot margins

A

Admin • 832.27K Points
Coach

Q. Which parameter controls the spacing between subplots?

  • (A) spacing
  • (B) space
  • (C) plt.subplots_adjust()
  • (D) plt.set_spacing()

A

Admin • 832.27K Points
Coach

Q. What is the use of 'zorder' in plotting?

  • (A) Sets zoom level
  • (B) Sets the drawing order of elements
  • (C) Changes transparency
  • (D) Sets axis labels

A

Admin • 832.27K Points
Coach

Q. Which module is required to create 3D plots?

  • (A) matplotlib.3d
  • (B) mpl_toolkits.mplot3d
  • (C) matplotlib.graphics
  • (D) mpl_3d

A

Admin • 832.27K Points
Coach

Q. What is the output of plt.hist() if 'bins=5'?

  • (A) 5 histograms
  • (B) 5 bars for 5 intervals
  • (C) Histogram with 5 colors
  • (D) Multiple line plots

A

Admin • 832.27K Points
Coach

Q. How can you change the color of axis spines?

  • (A) ax.spines['top'].set_color('red')
  • (B) plt.axis_color('top', 'red')
  • (C) plt.set_spine_color('top')
  • (D) ax.color('top')

A

Admin • 832.27K Points
Coach

Q. Which method disables the top and right axes spines?

  • (A) ax.spines['top'].hide()
  • (B) ax.remove(['top','right'])
  • (C) ax.spines['top'].set_visible(False); ax.spines['right'].set_visible(False)
  • (D) ax.set_axis_off()

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