示例#1
0
def hgm_family_constant_image(AB):
    # piecewise constant
    A, B = AB.split("_")
    from plot import piecewise_constant_image
    A = map(int, A[1:].split("."))
    B = map(int, B[1:].split("."))
    G = piecewise_constant_image(A, B)
    return image_callback(G)
示例#2
0
def hgm_family_constant_image(AB):
    # piecewise constant
    A,B = AB.split("_")
    from plot import piecewise_constant_image
    A = map(int,A[1:].split("."))
    B = map(int,B[1:].split("."))
    G = piecewise_constant_image(A, B)
    return image_callback(G)
示例#3
0
    def plot(self, typ="circle"):
        assert typ in ['circle', 'linear', 'constant']
        if typ == 'circle':
            G = circle_image(self.A, self.B)
        elif typ == 'linear':
            G = piecewise_linear_image(self.A, self.B)
        else:
            G = piecewise_constant_image(self.A, self.B)

        return encode_plot(G.plot(),
                           pad=0,
                           pad_inches=0,
                           bbox_inches='tight',
                           remove_axes=True)