def print_js_style_roc_test_result(mat_id):
    group_rel = init_pdb_groups_relation()
    mat  = DistanceMatrix(mat_id  = mat_id )
    x_arr , y_arr , _ = perform_roc_test(group_rel  , mat  ,101)
    xy_arr = []
    x_arr.reverse();y_arr.reverse();#reverse the order so that jqplot can draw properly
    for x,y in zip(x_arr , y_arr):
        xy_arr.append("[%f , %f]" %(x , y))
    sys.stderr.write("var $%s = [ %s ];\n" %(mat_id , ','.join(xy_arr)))        
def batch_plot(mat_ids , test_iter_counts = 22):
    """ plot the given ids in one plot"""

    group_rel = init_pdb_groups_relation()
    plt.hold(True)
    color_scheme = []
    for mat_id in mat_ids:
        mat  = DistanceMatrix(mat_id  = mat_id )
        x , y , _ = perform_roc_test(group_rel  , mat , test_iter_counts )
        plt.plot(x , y )
    plt.savefig("tmp.jpg")