Skip to content

Commit

Permalink
Fixed the bugm, where some of the column names might not fit to the f…
Browse files Browse the repository at this point in the history
…igure
  • Loading branch information
raivokolde committed Sep 18, 2013
1 parent a6436cb commit e19d2d2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pheatmap
Type: Package
Title: Pretty Heatmaps
Version: 0.7.6
Version: 0.7.7
Date: 2013-30-3
Author: Raivo Kolde
Maintainer: Raivo Kolde <[email protected]>
Expand Down
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 0.7.7
-------------------------------------------------------------------------------
Fixed a bug related to calculating space for the column and row names.

Added .Rbuildignore

Version 0.7.6
-------------------------------------------------------------------------------
Fixed a bug, where the color scales for scaled matrices were not centered to 0.
Expand Down
2 changes: 1 addition & 1 deletion R/pheatmap-package.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#'
#' @import grid
#'
NA
NA
10 changes: 5 additions & 5 deletions R/pheatmap.r
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
lo = function(rown, coln, nrow, ncol, cellheight = NA, cellwidth = NA, treeheight_col, treeheight_row, legend, annotation, annotation_colors, annotation_legend, main, fontsize, fontsize_row, fontsize_col, ...){
# Get height of colnames and length of rownames
if(!is.null(coln[1])){
longest_coln = which.max(nchar(coln))
longest_coln = which.max(strwidth(coln, units = 'in'))
gp = list(fontsize = fontsize_col, ...)
coln_height = unit(1.1, "grobheight", textGrob(coln[longest_coln], rot = 90, gp = do.call(gpar, gp)))
coln_height = unit(1, "grobheight", textGrob(coln[longest_coln], rot = 90, gp = do.call(gpar, gp))) + unit(5, "bigpts")
}
else{
coln_height = unit(5, "bigpts")
}

if(!is.null(rown[1])){
longest_rown = which.max(nchar(rown))
longest_rown = which.max(strwidth(rown, units = 'in'))
gp = list(fontsize = fontsize_row, ...)
rown_width = unit(1.2, "grobwidth", textGrob(rown[longest_rown], gp = do.call(gpar, gp)))
rown_width = unit(1, "grobwidth", textGrob(rown[longest_rown], gp = do.call(gpar, gp))) + unit(10, "bigpts")
}
else{
rown_width = unit(5, "bigpts")
Expand Down Expand Up @@ -545,7 +545,7 @@ kmeans_pheatmap = function(mat, k = min(nrow(mat), 150), sd_limit = NA, ...){
#' the extension in the path. Currently following formats are supported: png, pdf, tiff,
#' bmp, jpeg. Even if the plot does not fit into the plotting window, the file size is
#' calculated so that the plot would fit there, unless specified otherwise.
#' @param width manual option for determining the output file width in
#' @param width manual option for determining the output file width in inches.
#' @param height manual option for determining the output file height in inches.
#' @param \dots graphical parameters for the text used in plot. Parameters passed to
#' \code{\link{grid.text}}, see \code{\link{gpar}}.
Expand Down

0 comments on commit e19d2d2

Please sign in to comment.