Alexander
Alexander

Reputation: 109520

automatically run %matplotlib inline in jupyter qtconsole

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

%matplotlib inline

Upvotes: 7

Views: 3854

Answers (3)

Dean Wong
Dean Wong

Reputation: 116

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

c.InteractiveShellApp.code_to_run = ''

==>

c.InteractiveShellApp.code_to_run = '%pylab inline'

Upvotes: 1

Amit Moscovich
Amit Moscovich

Reputation: 2898

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')

Upvotes: 4

screenpaver
screenpaver

Reputation: 1130

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

c.InteractiveShellApp.matplotlib = 'inline'

Upvotes: 10

Related Questions