Ipython exists

54 views
Skip to first unread message

Sebastian Schaetz

unread,
Oct 26, 2011, 12:35:19 PM10/26/11
to glumpy-users
Hi,

I'm using glumpy as a tool to easily visualize 2d numpy data
interactively from the ipython. My problem is that ipython is not
responsive as long as the glumpy window is open and (more importantly)
that ipython exits after I close the window. I'm on Ubuntu 11.10 x64
and I tried both with ipython 0.11 and the default 0.10.2.

This is the code I use

def showm(data, dim):
# expect 3 dimensional x, y and frame
print data.shape
x = data.shape[0]
y = data.shape[1]

fig = glumpy.figure(size=(x, y))
frame = fig.add_frame(aspect=1)
image = glumpy.image.Image(abs(data[:, :, dim]))

@fig.event
def on_draw():
fig.clear()
frame.draw(x=frame.x, y=frame.y )
image.draw(x=frame.x, y=frame.y, z=0,
width=frame.width, height=frame.height )
fig.show()

and I run it like so from ipython
showm(a,5)

What am I doing wrong?
Thans in advance,
Sebastian

Nicolas Rougier

unread,
Oct 26, 2011, 4:40:02 PM10/26/11
to glumpy-users

Did you enter the glut gui from ipython ?
(You have to type "%gui glut" from the ipython shell or to give it on
the command line)


Nicolas



On Oct 26, 6:35 pm, Sebastian Schaetz <seb.scha...@googlemail.com>
wrote:

Sebastian Schaetz

unread,
Oct 27, 2011, 8:09:28 AM10/27/11
to glumpy-users
On Oct 26, 10:40 pm, Nicolas Rougier <nicolas.roug...@gmail.com>
wrote:
> Did you enter the glut gui from ipython ?
> (You have to type "%gui glut" from the ipython shell or to give it on
> the command line)
>

Indeed that works! Thanks a lot!
Reply all
Reply to author
Forward
0 new messages