Newbie question/closing a figure-window

I have the vague remembrance of the fact that IDLE does not play well with matplotlib. Can you try to run the program from the command line and see if it gives the same error?




Massimo Sandal , Ph.D.
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy



tel: +39-051-2094388
fax: +39-051-2094387

-----Messaggio originale-----
Da: Hajas, Wayne [mailto:Wayne.Hajas@…2447…]
Inviato: mar 13/01/2009 21.05
Oggetto: [Matplotlib-users] Newbie question/closing a figure-window

I'm just getting into matplotlib and python. My apologies if I just
haven't found the obvious documentation.

I am running XP/Enthought Python 2.5/Idle/matplotlib

I run one of the scripts from the tutorial:

  import numpy as np
  import matplotlib.pyplot as plt

  mu, sigma = 100, 15
  x = mu + sigma * np.random.randn(10000)

  # the histogram of the data
  n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g',

  plt.title('Histogram of IQ')
  plt.text(60, .025, r'$\mu=100,\ \sigma=15$')
  plt.axis([40, 160, 0, 0.03])

A window with the figure appears on my screen. It looks very nice. But
now my PYTHON-Shell screen is dead.

I can go to the figure window. I right click on the upper-border to
close the window. I get the following error message on the

  Exception in Tkinter callback
  Traceback (most recent call last):
    File "C:\Python25\lib\lib-tk\", line 1403, in
      return self.func(*args)
    File "C:\Python25\lib\idlelib\", line 151, in
      r = l[i](event)
    File "C:\Python25\lib\idlelib\", line 166, in
    File "C:\Python25\lib\idlelib\", line 701, in
  AttributeError: ModifiedInterpreter instance has no attribute

And the shell-window is still dead. I can't do anything else until I
close all my Python windows.

Is there a better way to close the figure-window?

Should I expect IDLE to work with matplotlib? Should I try and figure
out Ipython instead?

Should I look for a Tkinter installation? My current version is
Revision: 50704?

Any help or suggestions are appreciated.

Wayne Hajas
Pacific Biological Station
3190 Hammond Bay Road
Nanaimo, BC
V9T 6N7
wayne.hajas@…2447… <mailto:hajasw@…2447…>