Skip to content

Commit

Permalink
making the box plot look nice
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiia committed Nov 26, 2018
1 parent 405e31b commit 50efe41
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 50efe41

Please sign in to comment.