The %matplotlib inline is nothing but a function of magic used in IPython which has a series of predefined magic functions which can be used with a common line which has the style syntax included. Line and Cell oriented are the two categories of magic where the former is prefixed with a % character and is similar to the operation of the OS command-line calls due to the presence of the argument lines where the argument is passed with the absence of quotes. These are used in the right hand side of the assignment. The latter are fixed at a double of the %% and works as a function where the argument is not the other half of the line but rather the lines in a separate argument mentioned below. If you want interactivity as well, you can use the nbagg backend with %matplotlib notebook used in IPython 3.x.