What does 'plt' signify in the following statement?
import matplotlib.pyplot as plt
What does 'plt' signify in the following statement?
import matplotlib.pyplot as plt
Solution
✅ Correct Option: 1
The keyword as in an import statement gives the module a shorter nickname, called an alias. Here, plt is the alias for matplotlib.pyplot, so you can write plt.plot() instead of matplotlib.pyplot.plot().
Option 2: plt is only a nickname, not a library. Matplotlib itself is also a third-party library that must be installed separately, so it is not inbuilt.
Options 3 and 4: plt is a name used inside the code and has nothing to do with the script's file name or the image file. An image is saved only with a call like plt.savefig("name.png").
Related questions:
2026: 29 May Shift 1
2025: 13 May Shift 2
2026: 29 May Shift 1