[IPython-User] IPython-User Digest, Vol 106, Issue 52

Ming Li lijianting84@gmail....
Wed Aug 29 00:13:21 CDT 2012


2012/8/29 <ipython-user-request@scipy.org>

> Send IPython-User mailing list submissions to
>         ipython-user@scipy.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mail.scipy.org/mailman/listinfo/ipython-user
> or, via email, send a message with subject or body 'help' to
>         ipython-user-request@scipy.org
>
> You can reach the person managing the list at
>         ipython-user-owner@scipy.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of IPython-User digest..."
>
>
> Today's Topics:
>
>    1. qtconsole (Francesco Montesano)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 28 Aug 2012 16:01:51 +0200
> From: Francesco Montesano <franz.bergesund@gmail.com>
> Subject: [IPython-User] qtconsole
> To: IPython-User@scipy.org
> Message-ID:
>         <CAOCdBKKM1_1yzuXEXQS00eGdE4vfUO+MswJ7rbos4M=
> Cdh+H2Q@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Dear Ipythoners,
>
> I have just begun to use the qtconsole to mostly because I want to see
> if vim-ipython (https://github.com/ivanov/vim-ipython) helps to speed
> me up when doing matplotlib plots and checks from the console.
> Up to now I've always used standard ipython (version 0.12.1)
>
> As I almost always use numpy and matplotlib I've set in the
> ipython_config.py
> lines = """
> import numpy as np
> import matplotlib.pyplot as plt
> plt.ion()
> print("")
> print("Numpy and matplotlib.pyplot imported as np and plt. Interactive
> mode on")
> """
> if hasattr(app, 'exec_lines'):
>     app.exec_lines.append(lines)
> else:
>     app.exec_lines = [lines]
>
> so that I start ipython with my standard setting. (If it is of any
> use, my default matplotlib backend is Qt4Agg)
>
> >From my understanding to have ipython qtconsole to show up a window
> with matplotlib plot I have to call it with the --pylab option or to
> use %pylabe inside the console.
>
> The probelm (ipython qtconsole --pylab):
> take the following scritp:
> #####test.py#####
> import matplotlib.pyplot as plt
> plt.plot( [1,2,3], label='test' )
> plt.legend()
> plt.draw()
> ###end test.py###
>
> If I paste the lines in the qtconsole the plot shows up as expected
> If I do %run test.py nothing shows up and if afterwards I try to plot
> anything else nothing happens.
> But if I substitute plt.draw() with plt.show() or if I call the latter
> in the console the plot is shown and then I can continue adding lines,
> making other figures etc.
>
> This behaviour shows up also in the the notebook. However in the
> standard ipython terminal I don't need the show command to have the
> plot window pop out.
>
> I see it as an inconsistency between the three "interfaces" of
> ipython, but I don't know if this is a bug or something intrinsic in
> the qtconsole and notebook.
>
> Can anyone enlighten me on this? Thanks
>
> Cheers,
> Francesco
>
>
> ------------------------------
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
> End of IPython-User Digest, Vol 106, Issue 52
> *********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120829/48aa7c62/attachment.html 


More information about the IPython-User mailing list