Skip to content

Commit

Permalink
plotHeatmap --yMin ... doesn't work, apparently because --yMin and --…
Browse files Browse the repository at this point in the history
…yMax are taken as strings and not converted to np.float64s. We can manually do that.
  • Loading branch information
dpryan79 committed Oct 19, 2016
1 parent 9271632 commit a9d5f0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2.3.6

* multiBamSummary will now not automatically append .npz to the output file name if it's not present. This was bug #436
* Fixed a bug with plotHeatmap where --yMin and --yMax didn't work

2.3.5

Expand Down
7 changes: 6 additions & 1 deletion deeptools/plotHeatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,13 @@ def plotMatrix(hm, outFileName,
ticks[0].label1.set_horizontalalignment('left')
ticks[-1].label1.set_horizontalalignment('right')

# reduce the number of yticks by half
# It turns out that set_ylim only takes np.float64s
if yMin:
yMin = np.float64(yMin)
if yMax:
yMax = np.float64(yMax)
ax_list[0].set_ylim(yMin, yMax)
# reduce the number of yticks by half
num_ticks = len(ax_list[0].get_yticks())
yticks = [ax_list[0].get_yticks()[i] for i in range(1, num_ticks, 2)]
ax_list[0].set_yticks(yticks)
Expand Down

0 comments on commit a9d5f0e

Please sign in to comment.