[R] double y-axis heatmap

From: Lee Zamparo <zamparo_at_gmail.com>
Date: Mon, 25 Feb 2008 14:06:24 -0500


Hi everyone,
I'm trying to add another 'y axis' to a heatmap that I generate thusly:

> heatmap(t(pemMatrix),Rowv=NA,Colv=NA,col=heat.colors(3),scale="row",main="PEM
scores by Tissue Type", xlab = "Tissues", ylab = "Contigs",margins = c(7,8), na.rm = TRUE)

The first y axis (on side 4, in axis() terms) indexes the columns in the transpose of pemMatrix (numeric data values). I want to add another y axis on the other side (side 2 in axis terms) to display the results of another test. I've checked the wiki and ?image, ?heatmap, and have been able to add something like what I want through the following:

> heatmap(t(pemMatrix),Rowv=NA,Colv=NA,col=heat.colors(3),scale="row",main="PEM
scores by Tissue Type", xlab = "Tissues", ylab = "Contigs",margins = c(7,8), na.rm = TRUE)
> par(new = TRUE, las=1)
> axis(2,at = axTicks(4), labels = as.character(kwResults[,2]))

 but the axis on side 2 is never scaled as the first axis on side 4. I've also checked par(), and the ylim for the graph is the same as what I set with at in the call to axis(). Can anyone shed some light on how heatmap is generating the y-axis on side 4?

Thanks,

Lee Zamparo

        [[alternative HTML version deleted]]



R-help_at_r-project.org 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. Received on Mon 25 Feb 2008 - 19:15:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Feb 2008 - 19:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive