Reputation: 1190
I am using the terminal in jupyter and am trying to plot with matplotlib. I need to plot inline and so i use %matplotlib inline
but i am getting the following error:
>>> %matplotlib inline
File "<stdin>", line 1
%matplotlib inline
^
SyntaxError: invalid syntax
Why am i getting this error? Is it because it is a terminal and not jupyter notebook type environment? I had tried the same code in jupyter notebook and it did not return any errors.
Upvotes: 0
Views: 225
Reputation: 19
trying using 'exec(%matplotlib inline)'
. Works for me on python3.6
Upvotes: 0
Reputation: 161
You should run ipython
instead of python
in the Jupyter terminal. Then you can execute any magic command.
Upvotes: 1