[R] how to save a heatmap.2 in png /jpeg /tiff

David Winsemius dwinsemius at comcast.net
Mon Sep 10 03:04:22 CEST 2012


On Sep 9, 2012, at 7:04 AM, STADLER Frederic wrote:

> Hey, I am still working on my heat map (for those who are read my previous post about row.names)∑
> Now, I would like to save my heat map.2 in .png or .tiff in order being able to work on the picture in photoshop, but it doesn't work.
> I'am using (as I have found on some forum)
>> png("heatmap.2.png)  # and it just doesn't work. when I try doing it with::
>> jpeg("heatmap.2.jpeg) # it works once every 10 times, but it's a 22kb file. completely use less !!!

Neither of those should have _ever_ "worked", since they both are missing closing quotes.

Furthermore, just emitting the command jpeg("filename.jpg") even with proper closing quotes will be completely useless, as you say, unless you follow the plot() command with dev.off().

?Devices
?jpeg  # and please DO the examples

> 
> I really need to have high quality image, as I will have to work on photoshop and also I will have to cut and zoom in just some lines of my heatmap.
> 
> #here is the code I use for my heatmap.2 :
>> heatmap.2(a_matrix, Rowv=NA, Colv =NA, col=greenred(60), scale="column", margins=c(7,10), trace="none", density.info=c("none"))
> 
> Does someone know what I have to do in order to get my heatmap.2.png ??? Do I need some other package (I only use gplots, to allow the heatpmap.2)
> 
Pleaese include complete code. What you have provided so far should, as you say, be "completely useless!!!".

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list