Top Matplotlib Interview Questions and Answers (MCQs)

The top Matplotlib Interview Questions and Answers are given here. The level of questions is suitable for beginners as well as advanced Python programmers. These are Matplotlib Multiple Choice Questions (MCQs) with answers:

Q1. How to correctly import pyplot submodule in Matplotlib?

  • import pyplot
  • import matplotlib pyplot
  • import matplotlib.pyplot

Q2. The plot() function belongs to which submodule of the Matplotlib library?

  • plt
  • pyplot
  • plotting
  • plots

Q3. To add grid lines to a graph in Matplotlib, which function is used?

  • grid()
  • gridlines()
  • grid_lines()
  • grids()

Q4. How to add labels to a plot in Matplotlib?

  • xlabel() and ylabel()
  • labelx() and labely()
  • x_label() and y_label()
  • labels()

Q5. Which Matplotlib function is used to set the title in a graph?

  • graph_title()
  • graph_titles()
  • titles()
  • title()

Q6. To position the title of a graph, use the ______ parameter of the title() function in Matplotlib.

  • position
  • loc
  • pos
  • location

Q7. The _______ function is used to create a legend in Matplotlib.

  • legends()
  • legend()

Q8. Set the background color of the legend using the ______ function in Matplotlib.

  • bgcolor()
  • set_bgcolor()
  • facecolor()
  • set_facecolor()

Q9. To change the font size of legends in a graph, use the ________ parameter of the legend() method in Matplotlib.

  • fontsize
  • font_size
  • size
  • sizeoffont

Q10. Plot a pie chart using the ______ method in Matplotlib.

  • pyplot.piechart()
  • pyplot.pie()
  • pyplot.pie_chart()

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Read More:

Matplotlib Introduction
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading