diff --git a/visualize.py b/visualize.py index 59f9ad9..892ed57 100644 --- a/visualize.py +++ b/visualize.py @@ -68,8 +68,36 @@ def make_box_plot(group1, group2, gene_names, scores, output_directory, figure_n for name in group2: group_two.append(scores[gene_names.index(name)]) - plt.figure() - plt.boxplot([group_one, group_two]) + #plt.figure() + #plt.boxplot([group_one, group_two]) + + groups_names = ['Important in ED', 'Not important in ED'] + + data = [group_one, group_two] + + fig, ax1 = plt.subplots(figsize=(10,10)) + #fig.canvas.set_window_title('The visualization of correlation between gene and exons length') + #fig.subplots_adjust(left=0.075, rigth=0.95, top=0.9, bottom=0.25) + + bp = ax1.boxplot(data, notch=0, sym='+', vert=1, whis=1.5) + plt.setp(bp['boxes'], color='black') + plt.setp(bp['whiskers'], color='black') + plt.setp(bp['fliers'], color='red', marker='+') + + # Add a horizontal grid to the plot, but make it very light in color + # so we can use it for reading data values but not be distracting + ax1.yaxis.grid(True, linestyle='-', which='major', color='lightgrey', alpha=0.5) + + # Hide these grid behind plot objects + #ax1.set_axisbelow(True) + + ax1.set_title('The visualization of correlation between gene and exons length') + ax1.set_xlabel('Groups') + ax1.set_ylabel('Number') + + #ax1.set_ylim(bottom, top) + ax1.set_xticklabels(np.repeat(groups_names, 2), rotation=45, fontsize=8) + plt.show()