Quantcast

Heatmap: draw horizontal line

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Heatmap: draw horizontal line

Paul Evans-5
Hi,

I wanted to draw a heatmap with some horizontal lines. For example:

#------ code ------
mat <- matrix(-1:1,7,9)
heatmap.2(mat,Rowv=NA,trace = 'none',key=F)

#----end code -----

In this heatmap, I want to subgroup the rows. For instance, I would like to group rows 5,6 & 7 together, and would draw a black line between rows 4 & 5 to demarcate the group. Similarly, I want to group rows 3 & 4 in one group, and would like to put a black line between rows 2 & 3.

I guess I'm looking for the 'hline' parameter or something, but couldn't find it in the documentation.

Any help would be appreciated!



     
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Heatmap: draw horizontal line

Prof. Dr. Matthias Kohl
Is

heatmap.2(mat,Rowv=NA,trace = 'none',key=F, add.expr = abline(h =
c(3.5,5.5), lwd = 3))

what your are looking for?

hth,
Matthias

Paul Evans schrieb:

> Hi,
>
> I wanted to draw a heatmap with some horizontal lines. For example:
>
> #------ code ------
> mat <- matrix(-1:1,7,9)
> heatmap.2(mat,Rowv=NA,trace = 'none',key=F)
>
> #----end code -----
>
> In this heatmap, I want to subgroup the rows. For instance, I would like to group rows 5,6 & 7 together, and would draw a black line between rows 4 & 5 to demarcate the group. Similarly, I want to group rows 3 & 4 in one group, and would like to put a black line between rows 2 & 3.
>
> I guess I'm looking for the 'hline' parameter or something, but couldn't find it in the documentation.
>
> Any help would be appreciated!
>
>
>
>      
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>  

--
Dr. Matthias Kohl
www.stamats.de

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Heatmap: draw horizontal line

Paul Evans-5
Thanks Matthias! Exactly what I was looking for.

Paul




________________________________
From: Matthias Kohl <[hidden email]>

Cc: [hidden email]
Sent: Wednesday, May 6, 2009 2:06:22 PM
Subject: Re: [R] Heatmap: draw horizontal line

Is

heatmap.2(mat,Rowv=NA,trace = 'none',key=F, add.expr = abline(h =
c(3.5,5.5), lwd = 3))

what your are looking for?

hth,
Matthias

Paul Evans schrieb:

> Hi,
>
> I wanted to draw a heatmap with some horizontal lines. For example:
>
> #------ code ------
> mat <- matrix(-1:1,7,9)
> heatmap.2(mat,Rowv=NA,trace = 'none',key=F)
>
> #----end code -----
>
> In this heatmap, I want to subgroup the rows. For instance, I would like to group rows 5,6 & 7 together, and would draw a black line between rows 4 & 5 to demarcate the group. Similarly, I want to group rows 3 & 4 in one group, and would like to put a black line between rows 2 & 3.
>
> I guess I'm looking for the 'hline' parameter or something, but couldn't find it in the documentation.
>
[[elided Yahoo spam]]

>
>
>
>      
>     [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>  

--
Dr. Matthias Kohl
www.stamats.de


     
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...