%matplotlib line magic causes SyntaxError in Python script
Line magics are only supported by the IPython command line. They cannot simply be used inside a script, because %something 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 run_line_magic function. Instead of %matplotlib inline, you will … Read more