plotting from xemacs always 1 step behind

This is a bit wierd.

If running from xemacs, it seems interactive plotting is always 1 step
behind.

For example, I do:

M-x py-shell
This brings up a *Python* buffer in Comint mode running Ipython.

In [1]: from pylab import *

In [2]: plot ([1,2,3])
Out[2]: [<matplotlib.lines.Line2D instance at 0xf563b0>]

In [3]: xlabel('time')
Out[3]: <matplotlib.text.Text instance at 0xf52758>

In [4]: ylabel ('volts')
Out[4]: <matplotlib.text.Text instance at 0xf533b0>

When I execute step 3, the time is not show, but the line is. When I do
step 4, now time is added.

Any clues?

I assume you have set 'interactive : True' in your rc file? What
backend are you using (you should be using tkagg from xemacs) since it
does not require GUI threading support.

  http://matplotlib.sf.net/interactive.html

JDH

···

On Feb 12, 2008 6:49 AM, Neal Becker <ndbecker2@...287...> wrote:

This is a bit wierd.

If running from xemacs, it seems interactive plotting is always 1 step
behind.

I did set interactive.

I was using QtAgg.

I hate tk.

···

On Tuesday 12 February 2008, John Hunter wrote:

On Feb 12, 2008 6:49 AM, Neal Becker <ndbecker2@...287...> wrote:
> This is a bit wierd.
>
> If running from xemacs, it seems interactive plotting is always 1 step
> behind.

I assume you have set 'interactive : True' in your rc file? What
backend are you using (you should be using tkagg from xemacs) since it
does not require GUI threading support.

  http://matplotlib.sf.net/interactive.html

JDH

[reposting in the correct thread]

Well, the problem is that GTK, WX and Qt require threading support to
use them properly interactively. ipython has special modes for these
to run the GUI mainloop in the separate thread. tk is special in this
regard, in that it runs from a standard python shell w/o threading
support. You may be able to configure ipython within xemacs to take
advantage of both xemacs and ipython's support for interactive qt
plotting in pylab.

JDH

···

On Feb 12, 2008 8:50 AM, Neal Becker <ndbecker2@...287...> wrote:

I did set interactive.

I was using QtAgg.

I hate tk.

John Hunter wrote:
>
> Well, the problem is that GTK, WX and Qt require threading support to
> use them properly interactively. ipython has special modes for these
> to run the GUI mainloop in the separate thread. tk is special in this
> regard, in that it runs from a standard python shell w/o threading
> support. You may be able to configure ipython within xemacs to take
> advantage of both xemacs and ipython's support for interactive qt
> plotting in pylab.

FWIW, everything's working correctly for me using
xemacs + ipython:

Xemacs 21.5
current svn snapshot of python-mode.el from
   http://sourceforge.net/projects/python
current ipython svn snapshot
Centos 5.1 and python 2.5.1

-- Phil