# Buggy code
def _init(self):
    if True:  # not self._initialized:
        self._set_transform()
        _pivot = self.Q.pivot
        self.Q.pivot = self.pivot[self.labelpos]
        # Hack: save and restore the Umask
        _mask = self.Q.Umask
        self.Q.Umask = ma.nomask
        self.verts = self.Q._make_verts(np.array([self.U]), np.zeros((1,)))
        self.Q.Umask = _mask
        self.Q.pivot = _pivot
        kw = self.Q.polykw
        kw.update(self.kw)
        self.vector = mcollections.PolyCollection(
            self.verts,
            offsets=[(self.X, self.Y)],
            transOffset=self.get_transform(),
            **kw,
        )
        if self.color is not None:
            self.vector.set_color(self.color)
        self.vector.set_transform(self.Q.get_transform())
        self.vector.set_figure(self.get_figure())
        self._initialized = True


# Traceback (TypeError)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1437, in __call__
return self.func(*args)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 236, in resize
self.show()
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 239, in draw
FigureCanvasAgg.draw(self)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py", line 421, in draw
self.figure.draw(self.renderer)
File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/figure.py", line 898, in draw
func(*args)
File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 1997, in draw
a.draw(renderer)
File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/quiver.py", line 304, in draw
self._init()
File "/usr/lib/pymodules/python2.7/matplotlib/quiver.py", line 272, in _init
np.zeros((1,)))
File "/usr/lib/pymodules/python2.7/matplotlib/quiver.py", line 571, in _make_verts
length = a * (widthu_per_lenu / (self.scale * self.width))
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

# Fixed code
def _init(self):
    if True:  # not self._initialized:
        if not self.Q._initialized:
            self.Q._init()
        self._set_transform()
        _pivot = self.Q.pivot
        self.Q.pivot = self.pivot[self.labelpos]
        # Hack: save and restore the Umask
        _mask = self.Q.Umask
        self.Q.Umask = ma.nomask
        self.verts = self.Q._make_verts(np.array([self.U]), np.zeros((1,)))
        self.Q.Umask = _mask
        self.Q.pivot = _pivot
        kw = self.Q.polykw
        kw.update(self.kw)
        self.vector = mcollections.PolyCollection(
            self.verts,
            offsets=[(self.X, self.Y)],
            transOffset=self.get_transform(),
            **kw,
        )
        if self.color is not None:
            self.vector.set_color(self.color)
        self.vector.set_transform(self.Q.get_transform())
        self.vector.set_figure(self.get_figure())
        self._initialized = True