<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clicked(self, event):
 """ Call if an element of this plottype is clicked. Implement in sub class. """

        group = event.artist._mt_group
        indices = event.ind

        # double click only supported on 1.2 or later
        major, minor, _ = mpl_version.split('.')
        if (int(major), int(minor)) < (1, 2) or not event.mouseevent.dblclick:
            for i in indices:
                print(self.groups[group][i].line_str)

        else:
            # toggle durline
            first = indices[0]
            logevent = self.groups[group][first]

            try:
                # remove triangle for this event
                idx = map(itemgetter(0), self.durlines).index(logevent)
                _, poly = self.durlines[idx]
                poly.remove()
                plt.gcf().canvas.draw()
                del self.durlines[idx]

            except ValueError:
                # construct triangle and add to list of durlines

                if self.args['optime_start']:
                    pts = [[date2num(logevent.datetime), 0],
                           [date2num(logevent.datetime), logevent.duration],
                           [date2num(logevent.datetime +
                                     timedelta(milliseconds=logevent.duration)
                                     ), 0]]
                else:
                    pts = [[date2num(logevent.datetime), 0],
                           [date2num(logevent.datetime), logevent.duration],
                           [date2num(logevent.datetime -
                                     timedelta(milliseconds=logevent.duration)
                                     ), 0]]

                poly = Polygon(pts, closed=True, alpha=0.2, linewidth=0,
                               facecolor=event.artist.get_markerfacecolor(),
                               edgecolor=None, zorder=-10000)

                ax = plt.gca()
                ax.add_patch(poly)
                plt.gcf().canvas.draw()

                self.durlines.append((logevent, poly))