Search This Blog

Tuesday, December 15, 2015

animating images in ipython notebook

Put this :
%matplotlib notebook

instead of
%matplotlib inline

  • The old %matplotlib inline activates the inline backend, which renders figures in the notebook as static pngs.
  • The new %matplotlib notebook activates the nbagg backend, added in matplotlib 1.4, which will include a javascript interface for interaction with inline figures in the notebook. This only works in IPython 3.x; for older IPython versions, use %matplotlib nbagg
  • nbagg is different than mpld3 in that it requires a live connection to a Python kernel. This allows it to be more feature complete than mpld3, but any static rendering of the notebook will not include the interactivity.