mouseevents raise Singular matrix exception

I use Debian stable. The python-matplotlib package version is 0.99.3-1.

Here is a small program which threw many exceptions whenever I moved the
mouse across the matplotlib display.

#! /usr/bin/env python

import matplotlib
import matplotlib.pyplot as plt

counts = [1, 8, 71]
diffs = range(len(counts))
plt.plot(diffs, counts)
plt.axes([0, 200, 0, 100])

Here is one of the tracebacks:

Exception in Tkinter callback
Traceback (most recent call last):
   File "/usr/lib/python2.6/lib-tk/", line 1413, in __call__
     return self.func(*args)
   File "/usr/lib/pymodules/python2.6/matplotlib/backends/", line 246, in motion_notify_event
     FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 1244, in motion_notify_event
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 899, in __init__
     LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 813, in __init__
     axes_list = [a for a in self.canvas.figure.get_axes() if a.in_axes(self)]
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 1538, in in_axes
     return self.patch.contains(mouseevent)[0]
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 502, in contains
     x, y = self.get_transform().inverted().transform_point(
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 1430, in inverted
     self._inverted = Affine2D(inv(mtx))
   File "/usr/lib/pymodules/python2.6/numpy/linalg/", line 423, in inv
     return wrap(solve(a, identity(a.shape[0], dtype=a.dtype)))
   File "/usr/lib/pymodules/python2.6/numpy/linalg/", line 306, in solve
     raise LinAlgError, 'Singular matrix'
LinAlgError: Singular matrix

A Google search on "matplotlib mouseevent singular matrix" found that
a similar problem was discussed in matplotlib-users on Jul 29, 2008:
"bar plot picker with 0 height data". John Hunter committed a fix:
"svn r5922". The program that caused the bug in 2008 works on my system.