Пример #1
0
    def heatmap(self, save_as=None, base=None, data=None, blackbg=False):
        u"""绘制热图"""

        self.__mkImg()

        circle = cf.mkCircle(10, self.width)
        heat_data = [0] * self.width * self.height

        data = data or self.data

        for hit in data:
            x, y, n = hit
            if x < 0 or x >= self.width or y < 0 or y >= self.height:
                continue

            self.__heat(heat_data, x, y, n, circle)

        self.__paintHeat(heat_data, cf.mkColors())
        if blackbg == True:
            self.__make_img_gray()

        if save_as:
            self.save_as = save_as
            self.__save()

        return self.__im
Пример #2
0
    def heatmap(self, save_as=None, base=None, data=None, blackbg=False):
        u"""绘制热图"""

        self.__mkImg()

        circle = cf.mkCircle(10, self.width)
        heat_data = [0] * self.width * self.height

        data = data or self.data

        for hit in data:
            x, y, n = hit
            if x < 0 or x >= self.width or y < 0 or y >= self.height:
                continue

            self.__heat(heat_data, x, y, n, circle)

        self.__paintHeat(heat_data, cf.mkColors())
        if blackbg == True:
            self.__make_img_gray()

        if save_as:
            self.save_as = save_as
            self.__save()

        return self.__im
Пример #3
0
    def heatmap(self, save_as=None, base=None):
        u"""绘制热图"""

        self.__mkImg()

        circle = cf.mkCircle(10, self.width)
        heat_data = [0] * self.width * self.height

        for hit in self.data:
            x, y, n = hit
            if x < 0 or x >= self.width or y < 0 or y >= self.height:
                continue

            self.__heat(heat_data, x, y, n, circle)

        self.__paintHeat(heat_data, cf.mkColors())

        if save_as:
            self.save_as = save_as
            self.__save()

        return self.__im
Пример #4
0
    def heatmap(self, save_as=None, base=None, data=None):

        self.__mkImg()

        circle = cf.mkCircle(8, self.width)
        heat_data = [0] * self.width * self.height

        data = data or self.data

        for hit in data:
            x, y, n, t = hit
            if x < 0 or x >= self.width or y < 0 or y >= self.height:
                continue
            self.__heat(heat_data, x, y, n, t, circle)

        self.__paintHeat(heat_data, cf.mkColors())

        if save_as:
            self.save_as = save_as
            self.__save()

        return self.__im
Пример #5
0
    def heatmap(self, save_as=None, base=None):
        u"""绘制热图"""

        self.__mkImg()

        circle = cf.mkCircle(10, self.width)
        heat_data = [0] * self.width * self.height

        for hit in self.data:
            x, y = hit[0], hit[1]
            if x < 0 or x >= self.width or y < 0 or y >= self.height:
                continue

            self.__heat(heat_data, x, y, circle)

        self.__paintHeat(heat_data, cf.mkColors())

        if save_as:
            self.save_as = save_as
            self.__save()

        return self.__im