Automatically run %matplotlib inline in IPython Notebook

后端 未结 7 1597
逝去的感伤
逝去的感伤 2020-11-28 20:06

Every time I launch IPython Notebook, the first command I run is

%matplotlib inline

Is there some way to change my config file so that when

7条回答
  •  时光说笑
    2020-11-28 21:09

    In your ipython_config.py file, search for the following lines

    # c.InteractiveShellApp.matplotlib = None
    

    and

    # c.InteractiveShellApp.pylab = None
    

    and uncomment them. Then, change None to the backend that you're using (I use 'qt4') and save the file. Restart IPython, and matplotlib and pylab should be loaded - you can use the dir() command to verify which modules are in the global namespace.

提交回复
热议问题