Automatically run% matplotlib inline in jupyter qtconsole

Is there a way to change the configuration file so that jupyter qtconsole runs the following command at startup ?:

%matplotlib inline 
+6
source share
3 answers

Add this line to ipython_config.py ( not ipython_qtconsole_config.py ):

 c.InteractiveShellApp.matplotlib = 'inline' 
+8
source

In your ipython_config.py file ipython_config.py you can specify the commands to run at startup (including magic% commands) by setting c.InteractiveShellApp.exec_lines . For instance,

 c.InteractiveShellApp.exec_lines = """ %matplotlib inline %autoreload 2 import your_favorite_module """.split('\n') 
+2
source

Open the file ~/.ipython/profile_default/ipython_config.py and

 c.InteractiveShellApp.code_to_run = '' 

==>

 c.InteractiveShellApp.code_to_run = '%pylab inline' 
+1
source

All Articles