[IPython-User] [Notebook] %pylab inline error

Francesco Montesano franz.bergesund@gmail....
Wed Jan 23 11:44:10 CST 2013


Hi,

2013/1/23 Paul Hobson <pmhobson@gmail.com>

> Ditch your startup files and just start the notebook with "ipython
> notebook --pylab=inline"
>
> Does that work?
>

Yes, it does.
Also keeping my startup files as they are and running "ipython notebook
--pylab=inline" shows the plots inline, as expected.

If I start the notebook with my settings, and then execute "%pylab inline"
I get the error. If I understand
https://github.com/ipython/ipython/pull/2179 I should be able to change the
backend to "inline". I'm using v 0.13.1.rc2 shipped with kubuntu 12.10 and
I've tried v0.13.1 compiled from source.
I've tried to use the master, but when I launch the notebook I get
"ImportError: No module named jinja2" (OT: do I need it to run the
notebook?)

Francesco


>
>  On Wed, Jan 23, 2013 at 4:40 AM, Francesco Montesano <
> franz.bergesund@gmail.com> wrote:
>
>>
>>
>>
>> 2013/1/11 Francesco Montesano <franz.bergesund@gmail.com>
>>
>>>
>>>
>>>
>>> 2013/1/11 Francesco Montesano <franz.bergesund@gmail.com>
>>>
>>>> Dear list,
>>>>
>>>> I use notebook mostly for testing reasons. Furthermore, as I use mostly
>>>> numpy and matplotlib, I have in ~/.ipython/profile_default/startup/ two
>>>> files:
>>>> 00-pylab.ipy, that calls %pylab (in my matplolibrc I set the backend to
>>>> QtAgg)
>>>> 01-interactive.py: call plt.ion()
>>>>
>>>> I have just discovered Pandas and I am documenting some of the tests
>>>> that I have done, and I would like to have an inline plot in my notebook.
>>>> From my understanding I should be able to toggle between backends using
>>>> *%pylab inline *and *%pylab ... *.
>>>> The cell where I do the plotting is:
>>>>
>>>> %pylab inline
>>>> north.plot(x=0, y=1, linestyle='none', marker='.', label="cat north",
>>>> color='b')
>>>> south.plot(x=0, y=1, linestyle='none', marker='.', label="cat south",
>>>> color='g')
>>>> north.plot(x=0, y=1, linestyle='none', marker=',', label="mocks north",
>>>> color='r')
>>>> south.plot(x=0, y=1, linestyle='none', marker=',', label="mocks south",
>>>> color='k')
>>>> plt.legend()
>>>>
>>>>
>>>> When I execute it, I get a long error ending in "RuntimeError: Cannot
>>>> activate multiple GUI eventloops"
>>>> Is this to be expected?
>>>>
>>>
>> bump: any idea about why this error is happening?
>>
>> Francesco
>>
>>
>>>  I can anyway display the figure with dispay(plt.gcf()). Is this
>>>> equivalent to have pylab inline?
>>>>
>>> I can answer myself: not really. If I call display it shows the figure
>>> in the browser and in the external window
>>>
>>> Fra
>>>
>>>>
>>>> Thanks in advance,
>>>>
>>>> Francesco
>>>>
>>>
>>>
>>
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>
>>
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20130123/294da522/attachment.html 


More information about the IPython-User mailing list