0

New to python - What is the difference between %matplotlib inline and import matplotlib ?

2
  • 1
    One difference is that import matplotlib is valid Python and %matplotlib inline is not :) Did you mean to tag this with jupyter and/or jupyter-notebook as well? Commented Sep 21, 2022 at 9:36
  • In modern Jupyter, you often no longer need %matplotlib inline. See here for understanding how even if not necessary you may wish to use it if you are regularly employing advanced Matplotlib settings. As for importing the matplotlib module, core Python is kept sparse for more flexibility/cleaner namespace & so in Python you need to import additional modules and packages that are more domain specific. Commented Sep 21, 2022 at 19:27

1 Answer 1

0

The part with the % is called a magic-command and only available in Jupyter/Ipython.

The import is part of python to import modules.

See:

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.