Beispiel #1
0
def readFile(ax, inputFile):
#   fig, ax = plt.subplots()
    inf = open(inputFile)
    line = inf.readline()
    
    bar_inc = [0, 0.35, 0.7];
    a = ['ICT','SCT','FD-CIT']
    color = ['k','w','y']
    j = 0
    lengthMin = 0
    while line:
        line = line.strip()
        if len(line) != 0 and line[0] == '(' and j < 2:
            [x, y] = dealLine(line)
            #get ride of bigger than 100
            if(inputFile.find('tcas') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 50]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])
                
            if j == 0:
                lengthMin = len(x)
                rectc1 = show.show1(ax, x + bar_inc[j], y, a[j], color[j])
            elif j == 1:
                rectc2 = show.show1_special(ax, x + bar_inc[j], y, lengthMin, a[j], color[j])
            j = j + 1
        line = inf.readline()   
    inf.close()
    
#    ax.set_title(title)
    bar_width = 0.35
    l = [int(i) for i in x[0:lengthMin]]
    ax.set_xticks(x[0:lengthMin] + bar_width, l)

    return rectc1, rectc2
Beispiel #2
0
def readFile(ax, inputFile):
#   fig, ax = plt.subplots()
    inf = open(inputFile)
    line = inf.readline()
    bar_inc = [0, 0.35, 0.7];
    a = ['ICT','SCT','FD']
    color = ['k','k','w']
    dot = ['-', '-.']
    mark = ['o','d']
    j = 0
    lengthMin = 0
    while line:
        line = line.strip()
        if len(line) != 0 and line[0] == '(':
            [x, y] = dealLine(line)
            #get ride of bigger than 100
            if(inputFile.find('tcas') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 50]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if(inputFile.find('2-way for tomcat.txt') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 15]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if(inputFile.find('3-way for tomcat.txt') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 25]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if(inputFile.find('2-way for HSQLDB.txt') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 15]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])
                
            if(inputFile.find('3-way for HSQLDB.txt') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 30]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])
                
            if(inputFile.find('4-way for HSQLDB.txt') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 40]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if(inputFile.find('2-way for JFlex.txt') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 15]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])
                
            if(inputFile.find('3-way for JFlex.txt') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 25]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if(inputFile.find('4-way for JFlex.txt') != -1):
                z = [(x[i],y[i]) for i in range(len(x)) if x[i] < 35]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])
                
            if j == 0:
                lengthMin = len(x)
                rectc1 = show.show2(ax, x, y, a[j], color[j], mark[j], dot[j])
            elif j == 1:
                rectc2 = show.show2_special(ax, x, y, lengthMin, a[j], color[j], mark[j], dot[j])
            else:
                rectc3 = show.show1(ax, x, y, a[j], color[j])
            j = j + 1
        line = inf.readline()   
    inf.close()
    
#    ax.set_title(title)
    bar_width = 0.35
    l = [int(i) for i in x[0:lengthMin]]
    ax.set_xticks(x[0:lengthMin] + bar_width, l)

    return rectc1, rectc2, rectc3
Beispiel #3
0
def readFile(ax, inputFile):
    #   fig, ax = plt.subplots()
    inf = open(inputFile)
    line = inf.readline()
    bar_inc = [0, 0.35, 0.7]
    a = ["ICT", "SCT", "FD-CIT"]
    color = ["k", "k", "w"]
    dot = ["-", "-."]
    mark = ["o", "d"]
    j = 0
    lengthMin = 0
    while line:
        line = line.strip()
        if len(line) != 0 and line[0] == "(":
            [x, y] = dealLine(line)
            # get ride of bigger than 100
            if inputFile.find("tcas") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 50]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if inputFile.find("2-way for tomcat.txt") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 15]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if inputFile.find("3-way for tomcat.txt") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 25]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if inputFile.find("2-way for HSQLDB.txt") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 15]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if inputFile.find("3-way for HSQLDB.txt") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 30]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if inputFile.find("4-way for HSQLDB.txt") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 40]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if inputFile.find("2-way for JFlex.txt") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 15]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if inputFile.find("3-way for JFlex.txt") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 25]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if inputFile.find("4-way for JFlex.txt") != -1:
                z = [(x[i], y[i]) for i in range(len(x)) if x[i] < 35]
                x = np.array([i[0] for i in z])
                y = np.array([i[1] for i in z])

            if j == 0:
                lengthMin = len(x)
                rectc1 = show.show2(ax, x, y, a[j], color[j], mark[j], dot[j])
            elif j == 1:
                rectc2 = show.show2_special(ax, x, y, lengthMin, a[j], color[j], mark[j], dot[j])
            else:
                rectc3 = show.show1(ax, x, y, a[j], color[j])
            j = j + 1
        line = inf.readline()
    inf.close()

    #    ax.set_title(title)
    bar_width = 0.35
    l = [int(i) for i in x[0:lengthMin]]
    ax.set_xticks(x[0:lengthMin] + bar_width, l)

    return rectc1, rectc2, rectc3