Here is what the above code is Doing:
1. We’re creating a figure object called fig, and an axis object in that figure called ax.
2. We’re plotting the data on that axes, and saving the returned Line2D object as the line object.
3. We’re adding a legend to the axis.
4. We’re setting the limits of the x- and y-axes to the min and max of the data.