Matplot Lib MCQs with answers Page - 3

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

Q. What does 'plt.tight_layout()' do in Matplotlib?

  • (A) Adds extra padding between subplots
  • (B) Automatically adjusts subplot parameters to give specified padding
  • (C) Removes all white space from the figure
  • (D) Fixes the aspect ratio

A

Admin • 828.03K Points
Coach

Q. Which of the following is used to create 3D plots in Matplotlib?

  • (A) plt.3dplot()
  • (B) mplot3d toolkit
  • (C) plt.plot3d()
  • (D) plt.surface()

A

Admin • 828.03K Points
Coach

Q. Which function adds text annotations to a plot in Matplotlib?

  • (A) plt.label()
  • (B) plt.text()
  • (C) plt.mark()
  • (D) plt.annotate()

A

Admin • 828.03K Points
Coach

Q. What does the 's' parameter in plt.scatter() represent?

  • (A) Shape of markers
  • (B) Spacing between points
  • (C) Size of markers
  • (D) Style of markers

A

Admin • 828.03K Points
Coach

Q. Which Matplotlib method is used to control the tick marks on the x-axis?

  • (A) plt.xticks()
  • (B) plt.set_ticks()
  • (C) plt.axis()
  • (D) plt.ticks()

A

Admin • 828.03K Points
Coach

Q. To customize the marker style in a plot, which parameter is used?

  • (A) mark
  • (B) symbol
  • (C) marker
  • (D) shape

A

Admin • 828.03K Points
Coach

Q. How do you plot a horizontal bar chart using Matplotlib?

  • (A) plt.hbar()
  • (B) plt.barh()
  • (C) plt.horizontalbar()
  • (D) plt.bar(horizontal=True)

A

Admin • 828.03K Points
Coach

Q. Which method would you use to set both x and y axis limits at once?

  • (A) plt.set_limits()
  • (B) plt.axis()
  • (C) plt.set_boundaries()
  • (D) plt.set_xy()

A

Admin • 828.03K Points
Coach

Q. What happens if you use 'plt.plot(x, y, "--r")'?

  • (A) A blue dotted line is drawn
  • (B) A red dashed line is drawn
  • (C) A solid green line is drawn
  • (D) An error occurs due to wrong syntax

A

Admin • 828.03K Points
Coach

Q. Which of the following can be used to display multiple plots in a grid layout?

  • (A) plt.multiplot()
  • (B) plt.subplots()
  • (C) plt.gridplot()
  • (D) plt.subplotgrid()