http://stackoverflow.com/questions/35595766/matplotlib-line-magic-causes-syntaxerror-in-python-script Line magics are only supported by the IPython command line. You cannot use it inside a script like this because it is not correct Python syntax. If you want to do this from a script you have to get access to the IPython API and then call the function. Instead of , you will have to do something like this in your script: |
10 down vote | Line magics are only supported by the IPython command line. You cannot use it inside a script like this because it is not correct Python syntax. If you want to do this from a script you have to get access to the IPython API and then call the function. Instead of , you will have to do something like this in your script: |