plotting/plot_website_ranking_results/plot_ranking.py
def plot_ranking_evaluation_linechart(score_file):
    '''
    Plot the ranking results using line chart
    '''
    mpl.rcParams['xtick.labelsize'] = 17
    mpl.rcParams['ytick.labelsize'] = 17
    #all_markers = ['+', 'o', "*", "s", "x", "h", "d", "<", ">"]
    ranks = []
    methods = []
    ids = []
    with open(score_file) as lines:
        for line in lines:
            values = line.strip().split(",")
            if values[1]=="random":
                continue
            methods.append(values[1])
            ranklist = [float(c) for c in values[2:]]
            ranks.append(ranklist)
            ids.append([i for i in xrange(len(ranklist))])

    plt.xlabel('ID', fontsize=17)
    plt.ylabel('Ranking Score', fontsize=17)
    #plt.ylim(ymin=0)
    for i, ranklist in enumerate(ranks):
        print ranklist
        #plt.plot(ids[i], ranklist, marker=all_markers[i])
        plt.plot(ids[i], ranklist)
    #plt.legend(names, loc='upper center', bbox_to_anchor=(0.5, 1.1), ncol=4, fancybox=True)
    leg = plt.legend(methods, loc='upper right', ncol=3, fancybox=True, fontsize=12)
    #leg.get_frame().set_alpha(0.1)
    #plt.xticks(ids)
    #plt.tight_layout()
    outfile = score_file.split("/")[-1].split(".")[0] 
    plt.savefig("plotting/ranking_comparision/" + outfile)

    Plot the ranking results using line chart
    
Plot the ranking results using line chart
Plot the ranking results using line chart
def plot_ranking_evaluation_linechart(score_file):
    mpl.rcParams['xtick.labelsize'] = 17
    mpl.rcParams['ytick.labelsize'] = 17
    ranks = []
    methods = []
    ids = []
    with open(score_file) as lines:
        for line in lines:
            values = line.strip().split(",")
            if values[1]=="random":
                continue
            methods.append(values[1])
            ranklist = [float(c) for c in values[2:]]
            ranks.append(ranklist)
            ids.append([i for i in xrange(len(ranklist))])
    plt.xlabel('ID', fontsize=17)
    plt.ylabel('Ranking Score', fontsize=17)
    for i, ranklist in enumerate(ranks):
        print ranklist
        plt.plot(ids[i], ranklist)
    leg = plt.legend(methods, loc='upper right', ncol=3, fancybox=True, fontsize=12)
    outfile = score_file.split("/")[-1].split(".")[0] 
    plt.savefig("plotting/ranking_comparision/" + outfile)
def plot_ranking_evaluation_linechart ( score_file ) : mpl . rcParams [ 'xtick.labelsize' ] = 17 mpl . rcParams [ 'ytick.labelsize' ] = 17 ranks = [ ] methods = [ ] ids = [ ] with open ( score_file ) as lines : for line in lines : values = line . strip ( ) . split ( "," ) if values [ 1 ] == "random" : continue methods . append ( values [ 1 ] ) ranklist = [ float ( c ) for c in values [ 2 : ] ] ranks . append ( ranklist ) ids . append ( [ i for i in xrange ( len ( ranklist ) ) ] ) plt . xlabel ( 'ID' , fontsize = 17 ) plt . ylabel ( 'Ranking Score' , fontsize = 17 ) for i , ranklist in enumerate ( ranks ) : print ranklist plt . plot ( ids [ i ] , ranklist ) leg = plt . legend ( methods , loc = 'upper right' , ncol = 3 , fancybox = True , fontsize = 12 ) outfile = score_file . split ( "/" ) [ - 1 ] . split ( "." ) [ 0 ] plt . savefig ( "plotting/ranking_comparision/" + outfile )
Plot the ranking results using line chart
Plot the ranking results using line chart
'''
    Plot the ranking results using line chart
    ''' #all_markers = ['+', 'o', "*", "s", "x", "h", "d", "<", ">"] #plt.ylim(ymin=0) #plt.plot(ids[i], ranklist, marker=all_markers[i]) #plt.legend(names, loc='upper center', bbox_to_anchor=(0.5, 1.1), ncol=4, fancybox=True) #leg.get_frame().set_alpha(0.1) #plt.xticks(ids) #plt.tight_layout()
score_file