Matplot Lib MCQs with answers Page - 6

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

Q. Which method is used to change the font size of tick labels?

  • (A) plt.set_fontsize()
  • (B) plt.tick_params()
  • (C) plt.label_font()
  • (D) plt.ticks_font()

A

Admin • 833.24K Points
Coach

Q. What is the purpose of 'plt.xlim()' in a plot?

  • (A) To change x-axis label
  • (B) To change x-axis color
  • (C) To set the limits of x-axis
  • (D) To hide the x-axis

A

Admin • 833.24K Points
Coach

Q. Which function can be used to display a horizontal line across the axes?

  • (A) plt.vline()
  • (B) plt.axhline()
  • (C) plt.line_horizontal()
  • (D) plt.hline()

A

Admin • 833.24K Points
Coach

Q. Which of these functions is used to create a stack plot?

  • (A) plt.stack()
  • (B) plt.stackplot()
  • (C) plt.plotstack()
  • (D) plt.layers()

A

Admin • 833.24K Points
Coach

Q. Which function plots a box-and-whisker plot in Matplotlib?

  • (A) plt.boxplot()
  • (B) plt.whiskerplot()
  • (C) plt.statsplot()
  • (D) plt.box()

A

Admin • 833.24K Points
Coach

Q. Which function in Matplotlib helps to display multiple heatmaps in subplots?

  • (A) plt.multiheatmap()
  • (B) plt.subplot_heatmap()
  • (C) plt.subplots() with imshow()
  • (D) plt.gridmap()

A

Admin • 833.24K Points
Coach

Q. How do you rotate x-tick labels by 90 degrees?

  • (A) plt.xticks(rotation=90)
  • (B) plt.rotate_xticks(90)
  • (C) plt.ticks(x=90)
  • (D) plt.set_xtick_rotation(90)

A

Admin • 833.24K Points
Coach

Q. What does the 'label' parameter do in plt.plot()?

  • (A) Sets the axis label
  • (B) Defines label for legend
  • (C) Changes the line style
  • (D) Changes font color

A

Admin • 833.24K Points
Coach

Q. What does 'ax.plot()' refer to?

  • (A) A method to draw plots using pyplot
  • (B) A method for saving plots
  • (C) A method of an Axes object to create plots
  • (D) A legend-creating method

A

Admin • 833.24K Points
Coach

Q. Which of the following is used to change the background color of a plot?

  • (A) plt.bgcolor()
  • (B) plt.style()
  • (C) fig.patch.set_facecolor()
  • (D) plt.set_theme()

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