Showing
1 changed file
with
1 additions
and
14 deletions
... | @@ -42,21 +42,9 @@ def import_ncRNA(path): | ... | @@ -42,21 +42,9 @@ def import_ncRNA(path): |
42 | ''' | 42 | ''' |
43 | Plot function | 43 | Plot function |
44 | ''' | 44 | ''' |
45 | -def colors_fn(nb): | ||
46 | - hsv = plt.get_cmap('hsv') | ||
47 | - return cm.rainbow(np.linspace(0,1,nb)) | ||
48 | - | ||
49 | -def make_autopct(pct,values): | ||
50 | - total = sum(values) | ||
51 | - val = int(round(pct*total/100.0)) | ||
52 | - return '{p:.2f}% ({v:d})'.format(p=pct,v=val) | ||
53 | - | ||
54 | def plot_repartition(data,m,n,name): | 45 | def plot_repartition(data,m,n,name): |
55 | - labels_names = ["rej1" if x==-1 else "rej2" if x==-2 else str(x) for x in data[0]] | 46 | + labels_names = [str(x) for x in data[0]] |
56 | repartition = data[1] | 47 | repartition = data[1] |
57 | - nb_label = len(data[0][data[0]>=0]) + 2 | ||
58 | - colors_raw = colors_fn(nb_label) | ||
59 | - colors = ['#%02x%02x%02x' % (255*x[0],255*x[1],255*x[2]) for x in colors_raw] | ||
60 | dico = [] | 48 | dico = [] |
61 | for i in range(m): | 49 | for i in range(m): |
62 | for j in range(n): | 50 | for j in range(n): |
... | @@ -75,7 +63,6 @@ def plot_repartition(data,m,n,name): | ... | @@ -75,7 +63,6 @@ def plot_repartition(data,m,n,name): |
75 | p += scale_x_discrete(name = "", limits = "1",labels=[""]) | 63 | p += scale_x_discrete(name = "", limits = "1",labels=[""]) |
76 | p += xlab("") | 64 | p += xlab("") |
77 | p += ylab("") | 65 | p += ylab("") |
78 | - p += scale_fill_manual(values=colors) | ||
79 | check_dir_file(name) | 66 | check_dir_file(name) |
80 | p.save(name+".png",width=6, height=7) | 67 | p.save(name+".png",width=6, height=7) |
81 | 68 | ... | ... |
-
Please register or login to post a comment