Hello, I have a large (919 X 919), hierarchically clustered heatmap that I would like to read the labels off of. I have tried saving the figure in pdf format and enlarging it until I can see the labels, but if I make the labels small enough to read (so that they don't overlap) using cexRow and cexCol, they do not appear in the pdf. The limit seems to be anything below cexRow or Col = 0.06. Is there a way to have smaller labels visible in the pdf? Is this an issue with resolution? I could get by with just a quarter of the heatmap (i.e. half of a row and half of a column) so that the labels don't have to be so small, but the heatmap must be clustered before this is done. I tried to cut the dendrogram at just the halfway point of the heatmap, but was not successful. Any suggestions? Thanks, Jacob -- View this message in context: http://r.789695.n4.nabble.com/Reading-labels-for-very-large-heatmaps-tp4644739.html Sent from the R help mailing list archive at Nabble.com.
Reading labels for very large heatmaps
5 messages · JIMonroe, Jean V Adams
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121002/dcced74b/attachment.pl>
5 days later
Jean, It's definitely bigger now, but my axes are cut-off. As in your example, I had them drawn after generating the heatmap, but the image does not seem to be centered. I think even part of the heatmap is getting cut off, which wasn't happening until I explicitly set the width and height of the pdf. Here is my code
pdf("Apo_Mut_Boot.pdf", width=200, height=200)
heatmap(x=as.matrix((Apo_Mut)), col =
colorRampPalette(c("white","black"))(256),
zlim=c(min(Apo_Mut),max(Apo_Mut)), add = FALSE, xaxs = "i", yaxs =
"i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue",
main="Apo-Mutant",revC=TRUE, Rowv = as.dendrogram(blah2), Colv =
as.dendrogram(blah2), reorderfun = function(d,w) rev(reorder(d,w)),
oldstyle = FALSE,cexRow=0.01,cexCol=0.01,symm=TRUE )
axis(1, at=1:919, labels=RowCol, las=2, cex=0.01)
axis(4, at=1:919, labels=RowCol, las=2, cex=0.01)
box()
graphics.off()
Jacob -- View this message in context: http://r.789695.n4.nabble.com/Reading-labels-for-very-large-heatmaps-tp4644739p4645391.html Sent from the R help mailing list archive at Nabble.com.
1 day later
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121009/c5258684/attachment.pl>
2 days later
Jean,
I have attached an example set of data. The code for reading and
manipulating it before display as a heatmap is as follows:
Apo_Mut<-read.table("Example_Data.txt")
require(cluster)
blah <- agnes(as.matrix(max(Apo_Mut)-Apo_Mut))
blah2<-as.hclust(blah)
LabsDend <- as.dendrogram(blah2)
RowCol<-order.dendrogram(LabsDend)
This should put my previous code into context. The way the heatmap is
set-up, the labels appear in the graphic, just not when it gets output to
the pdf.
Thanks, Jacob Example_Data.txt
<http://r.789695.n4.nabble.com/file/n4645953/Example_Data.txt>
--
View this message in context: http://r.789695.n4.nabble.com/Reading-labels-for-very-large-heatmaps-tp4644739p4645953.html
Sent from the R help mailing list archive at Nabble.com.