[R] abline on heatmap

Sarah Goslee sarah.goslee at gmail.com
Sat Mar 20 21:13:51 CET 2010


You can use abline, but heatmap rescales the x and y coordinates to
min of 0, max of 1. You can use the max x and y values to find the
desired location for the line.

Sarah

On Sat, Mar 20, 2010 at 4:02 PM, Tim Smith <tim_smith_666 at yahoo.com> wrote:
> Hi,
>
> Is there a way I can draw an abline on a heatmap? I try the abline function, but don't get the line. My sample code is:
> mat <- matrix(sample(1:100,40),nrow=5)
> heatmap(mat,col=greenred(75),trace="none",
> dendrogram = "column",labCol = NULL)
> abline(h=5,v=4)
>
>
> thanks!
>
-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list