Show the data graphically in a new pop-up window.

def show(self):
        """Show the data graphically in a new pop-up window."""

        # prevent the following error:
        # '_tkinter.TclError: no display name and no $DISPLAY environment
        #    variable'
        # import matplotlib
        # matplotlib.use('GTK3Agg', warn=False)

        import matplotlib.pyplot as plt

        pointlist = self.get_pointlist()
        if 'pen_down' in pointlist[0][0]:
            assert len(pointlist) > 1, \
                "Lenght of pointlist was %i. Got: %s" % (len(pointlist),
                                                         pointlist)
            # Create a new pointlist that models pen-down strokes and pen
            # up strokes
            new_pointlist = []
            last_pendown_state = None
            stroke = []
            for point in pointlist[0]:
                if last_pendown_state is None:
                    last_pendown_state = point['pen_down']
                if point['pen_down'] != last_pendown_state:
                    new_pointlist.append(stroke)
                    last_pendown_state = point['pen_down']
                    stroke = []
                else:
                    stroke.append(point)
            new_pointlist.append(stroke)  # add the last stroke
            pointlist = new_pointlist

        _, ax = plt.subplots()
        ax.set_title("Raw data id: %s, "
                     "Formula_id: %s" % (str(self.raw_data_id),
                                         str(self.formula_id)))

        colors = _get_colors(self.segmentation)
        for symbols, color in zip(self.segmentation, colors):
            for stroke_index in symbols:
                stroke = pointlist[stroke_index]
                xs, ys = [], []
                for p in stroke:
                    xs.append(p['x'])
                    ys.append(p['y'])
                if "pen_down" in stroke[0] and stroke[0]["pen_down"] is False:
                    plt.plot(xs, ys, '-x', color=color)
                else:
                    plt.plot(xs, ys, '-o', color=color)
        plt.gca().invert_yaxis()
        ax.set_aspect('equal')
        plt.show()