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@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.