plt is the alias name for the matplotlib library. you need to write the below line before running the code
import matplotlib.pyplot as plt
Note: In the notebook, you need to run the code cells from the start. This will ensure that all the required packages imported and the variables used in subsequent cells are initialized.