# Buggy code
def draw(self, renderer):
    if not self.get_visible():
        return

    self._update(renderer)  # update the tick

    size = self._ticksize
    path_trans = self.get_transform()

    gc = renderer.new_gc()
    gc.set_foreground(self.get_markeredgecolor())
    gc.set_linewidth(self.get_markeredgewidth())
    gc.set_alpha(self._alpha)

    offset = renderer.points_to_pixels(size)
    marker_scale = Affine2D().scale(offset, offset)

    if self.get_tick_out():
        add_angle = 180
    else:
        add_angle = 0

    marker_rotation = Affine2D()
    marker_transform = marker_scale + marker_rotation

    for loc, angle in self.locs_angles:
        marker_rotation.clear().rotate_deg(angle + add_angle)
        locs = path_trans.transform_non_affine([loc])
        if self.axes and not self.axes.viewLim.contains(*locs[0]):
            continue
        renderer.draw_markers(
            gc,
            self._tickvert_path,
            marker_transform,
            Path(locs),
            path_trans.get_affine(),
        )

    gc.restore()


# Traceback (TypeError)
Traceback (most recent call last):
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 519, in _draw_idle
self.draw()
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 433, in draw
self.figure.draw(self.renderer)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/figure.py", line 1475, in draw
renderer, self, artists, self.suppressComposite)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/image.py", line 141, in _draw_list_compositing_images
a.draw(renderer)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/parasite_axes.py", line 286, in draw
self._get_base_axes_attr("draw")(self, renderer)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/mpl_toolkits/axisartist/axislines.py", line 756, in draw
super(Axes, self).draw(renderer, inframe)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 2607, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/image.py", line 141, in _draw_list_compositing_images
a.draw(renderer)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/mpl_toolkits/axisartist/axis_artist.py", line 1479, in draw
self._draw_ticks(renderer)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/mpl_toolkits/axisartist/axis_artist.py", line 1211, in _draw_ticks
self.major_ticks.draw(renderer)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/mpl_toolkits/axisartist/axis_artist.py", line 330, in draw
locs = path_trans.transform_non_affine([loc])
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/transforms.py", line 2489, in transform_non_affine
return self._a.transform_non_affine(points)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/transforms.py", line 2263, in transform_non_affine
x_points = x.transform_non_affine(points)[:, 0:1]
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/transforms.py", line 2489, in transform_non_affine
return self._a.transform_non_affine(points)
File "/opt/anaconda2/envs/py2_conda52/lib/python2.7/site-packages/matplotlib/transforms.py", line 2265, in transform_non_affine
x_points = x.transform_non_affine(points[:, 0])
TypeError: list indices must be integers, not tuple

# Fixed code
def draw(self, renderer):
    if not self.get_visible():
        return

    self._update(renderer)  # update the tick

    size = self._ticksize
    path_trans = self.get_transform()

    gc = renderer.new_gc()
    gc.set_foreground(self.get_markeredgecolor())
    gc.set_linewidth(self.get_markeredgewidth())
    gc.set_alpha(self._alpha)

    offset = renderer.points_to_pixels(size)
    marker_scale = Affine2D().scale(offset, offset)

    if self.get_tick_out():
        add_angle = 180
    else:
        add_angle = 0

    marker_rotation = Affine2D()
    marker_transform = marker_scale + marker_rotation

    for loc, angle in self.locs_angles:
        marker_rotation.clear().rotate_deg(angle + add_angle)
        locs = path_trans.transform_non_affine(np.array([loc]))
        if self.axes and not self.axes.viewLim.contains(*locs[0]):
            continue
        renderer.draw_markers(
            gc,
            self._tickvert_path,
            marker_transform,
            Path(locs),
            path_trans.get_affine(),
        )

    gc.restore()