Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manipulate inline figure in IPython notebook

I am using IPython 0.12.1 notebook to connect from a Windows machine to a Linux server where the IPython kernel runs. Since the Linux machine doesn't have an X-Server installed, I am using the following configuration:

IPKernelApp.pylab = 'inline'

which displays the figures inline.

IPython closes the figures once they are drawn in the notebook. So how can I edit the figure which was just drawn? Like adding a title. The drawing process takes a while for my case and I would appreciate a means to play with the figure before saving it without a need to redraw it.

I tried saving a handle to the figure and working with that, but I was not successful.

like image 859
Choghazanbil Avatar asked Jan 17 '23 12:01

Choghazanbil


2 Answers

I ended up setting the following in the ipython notebook configuration file:

c.InlineBackend.close_figures = False

The figures are editable but I have to close them myself instead which I do by close('all')

like image 77
Choghazanbil Avatar answered Jan 19 '23 03:01

Choghazanbil


You can enter this magic configuration:

%config InlineBackend.close_figures = False
like image 20
Davoud Taghawi-Nejad Avatar answered Jan 19 '23 03:01

Davoud Taghawi-Nejad