All Courses

Automatically run %matplotlib inline in IPython Notebook

By Pritam Shinde, a year ago
  • Bookmark

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 I launch IPython, it is automatically in this mode?

1 Answer

You can always start all your IPython kernels in inline mode by default by setting the following config options in your config files:

  Default: None
  Choices: ['auto', 'gtk', 'gtk3', 'inline', 'nbagg', 'notebook', 'osx', 'qt', 'qt4', 'qt5', 'tk', 'wx']
  Configure matplotlib for interactive use with the default matplotlib backend.


IPython has profiles for configuration, located at ~/.ipython/profile_*. The default profile is called profile_default. Within this folder there are two primary configuration files:


Add the inline option for matplotlib to

c = get_config()
# ... Any other configurables you want to set
c.InteractiveShellApp.matplotlib = "inline"

Your Answer


Why You Should Learn Data Science in 2022?

Dec 15th (7:00 PM) 277 Registered
More webinars

Related Discussions

Running random forest algorithm with one variable

View More