0

Within a Jupyter Notebook, why is it necessary to include this line:

%matplotlib inline

This seems to be required for matplotlib to work.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.