Within a Jupyter Notebook, why is it necessary to include this line:
%matplotlib inline
This seems to be required for matplotlib to work.
It is not necessary to include the line %matplotlib inline in a jupyter notebook.
Introducing this line selects the backend for matplotlib plotting to be the inline backend. This simplifies a lot of things, such as showing figures. If this backend is selected, a figure will automatically appear in the output once it is meantionned in a cell.
Without having selected the %matplotlib inline backend, you would need to call plt.show() to show the matplotlib output.