Browse code

bug fixed in gheatmap

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@107839 bc3139a8-67e5-0310-9ffc-ced21a209358

g.yu authored on 27/08/2015 07:00:43
Showing 2 changed files

  • NEWS index 8b841590..e7ae8bc9 100644
  • R/gplot.R index d4e71b79..08a5d001 100644
... ...
@@ -1,5 +1,6 @@
1 1
 CHANGES IN VERSION 1.1.17
2 2
 ------------------------
3
+ o bug fixed in gheatmap, remove inherit aes from ggtree <2015-08-27, Thu>
3 4
  o add 'width' parameter to add_legend, now user can specify the width of legend bar <2015-08-27, Thu>
4 5
  o add 'colnames_position' parameter to gheatmap, now colnames can be display on the top of heatmap <2015-08-27, Thu> 
5 6
  o theme_transparent to make background transparent <2015-08-27, Thu>
... ...
@@ -56,7 +56,7 @@ gheatmap <- function(p, data, offset=0, width=1, low="green", high="red",
56 56
 
57 57
     dd$x <- V2
58 58
 
59
-    p2 <- p + geom_tile(data=dd, aes(x, y, fill=value), color=color)
59
+    p2 <- p + geom_tile(data=dd, aes(x, y, fill=value), color=color, inherit.aes=FALSE)
60 60
 
61 61
     if (is(dd$value,"numeric")) {
62 62
         p2 <- p2 + scale_fill_gradient(low=low, high=high, na.value="white")
... ...
@@ -70,7 +70,7 @@ gheatmap <- function(p, data, offset=0, width=1, low="green", high="red",
70 70
         } else {
71 71
             y <- max(p$data$y) + 1
72 72
         }
73
-        p2 <- p2 + geom_text(data=mapping, aes(x=to, label=from), y=y, size=font.size)
73
+        p2 <- p2 + geom_text(data=mapping, aes(x=to, label=from), y=y, size=font.size, inherit.aes = FALSE)
74 74
     }
75 75
 
76 76
     p2 <- p2 + theme(legend.position="right", legend.title=element_blank())