7

Is there a way to change the config file to make jupyter qtconsole run the following command on startup?:

%matplotlib inline

3 Answers 3

10

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

c.InteractiveShellApp.matplotlib = 'inline'
1
  • 2
    Awesome. I was unaware of all the customization that could be done with the ipython_config.py file... If anyone else doesn't already have that file, run ipython profile create.
    – userABC123
    Commented Dec 15, 2015 at 4:17
4

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

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

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

c.InteractiveShellApp.code_to_run = ''

==>

c.InteractiveShellApp.code_to_run = '%pylab inline'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.