Home »
Python »
Matplotlib MCQs
Which is the correct import statement to import pyplot?
9. Which is the correct import statement to import pyplot?
- import matplotlib.pyplot as plt
- import pyplot from matplotlib
- Both A and B
- None of the above
Answer: A) import matplotlib.pyplot as plt
Explanation:
The pyplot is the most useful utility /submodule of matplotlib and the correct import statement to import pyplot is:
import matplotlib.pyplot as plt