0

I am trying to use the R function heatmap.2 (from gplots package). The text labeling the columns is unreadable after saving to png. I have tried using the par command to make the figure larger, cexCol to make the text smaller, and colSep to make the cells on the heatmap farther apart, yielding more room for the text.

Below is a link to a zoomed in screenshot of the bottom of my heatmap. Also, here are my commands:

png(file=paste(path,filename))
heatmap.2(data,na.rm=TRUE,dendrogram='none',key=F,cexCol=.1,trace='none') 
par(fin=(c(20,4)),new=TRUE) #I've tried x=10,14 for c(x,4)
dev.off()

heatmap link: http://s24.postimg.org/hr6nyf01h/heatmap_Failed.png

Is there any way to make this text readable after the heatmap command? I'm definitely open for better tools if that is what it takes.

Much Thanks in advance.

enter image description here

user27037
  • 1
  • 3
  • I will post a link to the picture, I got blocked (not enough rep). – user27037 Jun 20 '13 at 19:10
  • Your picture don't help a lot to get what you do want to do. – agstudy Jun 20 '13 at 19:43
  • The picture is the end goal. I apologize if that was not clear. I'm not trying to work directly on the picture. I was trying to show that my current commands result in unreadable labels. That is what I want to correct. – user27037 Jun 20 '13 at 19:45
  • Are you aiming for web or print? The solutions vary a bit - e.g., if it's web and you expect people to be zooming it, you could try saving it in a vector format like pdf or svg. For print, I think you'll have to keep tweaking the parameters - I'm not sure how to best go about that. – Matt Parker Jun 20 '13 at 19:47
  • I am aiming for print. – user27037 Jun 20 '13 at 19:50
  • Have you tried turning up the resolution as well as the size? (it's the `res` argument to `png()`). Start with `res = 300`. – Matt Parker Jun 20 '13 at 19:52
  • @MattParker Thank you very much that did it. Final commands were just an edit of the png arguments (res=600,width=2000, height=2000). – user27037 Jun 20 '13 at 20:04
  • @user27037 Glad to hear it! I'm going to go ahead and suggest that this post be closed, since the question I linked to above has all the relevant info. – Matt Parker Jun 20 '13 at 20:11

0 Answers0