number_triangle.py
def plot(A, limlow, limhigh, xshift, yshift, base, colors, ax):
    """
    This function plots the number triangle for a given integer.
    :param A: The matrix resulting from getMat function.
    :param limlow: The lower xlim and ylim for plot.
    :param limhigh: The higher xlim and ylim for plot.
    :param xshift: The x-translation desired.
    :param yshift: The y-translation desired.
    :param base: The base used for getMat
    :param colors: Different colors for different congruent classes. Must be at least the size
    equal to base.
    :param ax: The plot handle.
    :return: Plot of the colored circles representing the number triangle.
    """
    r = (limhigh-limlow)/(A.shape[0])/2

    for k in range(A.shape[0]):
        if (np.mod(k, 2) == 0):
            count = 0
            for l in range(A.shape[1]):
                for u in range(base):
                    if(A[k,l] == u):
                        circle = plt.Circle((xshift + limlow + r + 2*r*count+(k*r), yshift + limhigh - r - 2*r * k), r, fill=True, color=colors[u].replace('0x','#'), linewidth=2)
                        ax.add_artist(circle)
                        count = count + 1
        if (np.mod(k, 2) == 1):
            count = 0
            for l in range(A.shape[1]):
                for u in range(base):
                    if (A[k, l] == u):
                        circle = plt.Circle((xshift + limlow + 2*r + 2*r * count+((k-1)*r), yshift + limhigh - r - 2*r * k), r, fill=True, color=colors[u].replace('0x','#'), linewidth=2)
                        ax.add_artist(circle)
                        count = count + 1

    This function plots the number triangle for a given integer.
    :param A: The matrix resulting from getMat function.
    :param limlow: The lower xlim and ylim for plot.
    :param limhigh: The higher xlim and ylim for plot.
    :param xshift: The x-translation desired.
    :param yshift: The y-translation desired.
    :param base: The base used for getMat
    :param colors: Different colors for different congruent classes. Must be at least the size
    equal to base.
    :param ax: The plot handle.
    :return: Plot of the colored circles representing the number triangle.
    
This function plots the number triangle for a given integer.
This function plots the number triangle for a given integer .
def plot(A, limlow, limhigh, xshift, yshift, base, colors, ax):
    r = (limhigh-limlow)/(A.shape[0])/2
    for k in range(A.shape[0]):
        if (np.mod(k, 2) == 0):
            count = 0
            for l in range(A.shape[1]):
                for u in range(base):
                    if(A[k,l] == u):
                        circle = plt.Circle((xshift + limlow + r + 2*r*count+(k*r), yshift + limhigh - r - 2*r * k), r, fill=True, color=colors[u].replace('0x','#'), linewidth=2)
                        ax.add_artist(circle)
                        count = count + 1
        if (np.mod(k, 2) == 1):
            count = 0
            for l in range(A.shape[1]):
                for u in range(base):
                    if (A[k, l] == u):
                        circle = plt.Circle((xshift + limlow + 2*r + 2*r * count+((k-1)*r), yshift + limhigh - r - 2*r * k), r, fill=True, color=colors[u].replace('0x','#'), linewidth=2)
                        ax.add_artist(circle)
                        count = count + 1
def plot ( A , limlow , limhigh , xshift , yshift , base , colors , ax ) : r = ( limhigh - limlow ) / ( A . shape [ 0 ] ) / 2 for k in range ( A . shape [ 0 ] ) : if ( np . mod ( k , 2 ) == 0 ) : count = 0 for l in range ( A . shape [ 1 ] ) : for u in range ( base ) : if ( A [ k , l ] == u ) : circle = plt . Circle ( ( xshift + limlow + r + 2 * r * count + ( k * r ) , yshift + limhigh - r - 2 * r * k ) , r , fill = True , color = colors [ u ] . replace ( '0x' , '#' ) , linewidth = 2 ) ax . add_artist ( circle ) count = count + 1 if ( np . mod ( k , 2 ) == 1 ) : count = 0 for l in range ( A . shape [ 1 ] ) : for u in range ( base ) : if ( A [ k , l ] == u ) : circle = plt . Circle ( ( xshift + limlow + 2 * r + 2 * r * count + ( ( k - 1 ) * r ) , yshift + limhigh - r - 2 * r * k ) , r , fill = True , color = colors [ u ] . replace ( '0x' , '#' ) , linewidth = 2 ) ax . add_artist ( circle ) count = count + 1
This function plots the number triangle for a given integer.
This function plots the number triangle for a given integer .
"""
    This function plots the number triangle for a given integer.
    :param A: The matrix resulting from getMat function.
    :param limlow: The lower xlim and ylim for plot.
    :param limhigh: The higher xlim and ylim for plot.
    :param xshift: The x-translation desired.
    :param yshift: The y-translation desired.
    :param base: The base used for getMat
    :param colors: Different colors for different congruent classes. Must be at least the size
    equal to base.
    :param ax: The plot handle.
    :return: Plot of the colored circles representing the number triangle.
    """
Plot of the colored circles representing the number triangle.
Plot of the colored circles representing the number triangle .
A
The matrix resulting from getMat function.
The matrix resulting from getMat function .
limlow
The lower xlim and ylim for plot.
The lower xlim and ylim for plot .
limhigh
The higher xlim and ylim for plot.
The higher xlim and ylim for plot .
xshift
The x-translation desired.
The x - translation desired .
yshift
The y-translation desired.
The y - translation desired .
base
The base used for getMat
The base used for getMat
colors
Different colors for different congruent classes. Must be at least the size
equal to base.
Different colors for different congruent classes . Must be at least the size equal to base .
ax
The plot handle.
The plot handle .