Пример #1
0
    def reformat(self, contours, *args):
        if contours is None:
            return {"xxs": [], "yys": [], "levels": []}

        xxs = []
        yys = []
        levels = sorted(contours.keys())
        colors = []
        (xmin, ymin) = args

        # Re-arrange results and project xs/ys back to the data space
        for (level, color) in zip(levels, self.palette):
            for trace in contours[level]:
                (xs, ys) = trace
                xs = xs + xmin
                ys = ys + ymin
                xxs.append(xs)
                yys.append(ys)
                colors.append(color)

        return {"levels": levels, "colors": colors, "xs": xxs, "ys": yys}
Пример #2
0
    def reformat(self, contours, *args):
        if contours is None:
            return {'xxs': [], 'yys': [], 'levels': []}

        xxs = []
        yys = []
        levels = sorted(contours.keys())
        colors = []
        (xmin, ymin) = args

        # Re-arrange results and project xs/ys back to the data space
        for (level, color) in zip(levels, self.palette):
            for trace in contours[level]:
                (xs, ys) = trace
                xs = xs + xmin
                ys = ys + ymin
                xxs.append(xs)
                yys.append(ys)
                colors.append(color)

        return {'levels': levels, 'colors': colors, 'xs': xxs, 'ys': yys}