[BioC] heatmap.2 how to remove row separator
Wolfgang Huber
whuber at embl.de
Fri Feb 25 16:11:13 CET 2011
Dear Benoit
in my experience this depends on the PDF viewer. For me, your PDF file
http://tinyurl.com/6yqcswr shows a hint of those white lines in
"Document Viewer 2.32.0", while it does not on "Adobe Reader 9.4.1"
(both on Ubuntu).
R's image function, on which these plots are based, is pretty peculiar -
it draws each matrix element as a filled polygon. Recently, support for
raster images was added to R devices, and this might be an alternative.
E.g., for the case of levelplot:
library("lattice")
m = matrix(runif(10000), nrow=5)
m[3,] = 0
col = heat.colors(100)
pdf("tmp1.pdf", width=5, height=10)
print(levelplot(m, col=col, aspect="fill"))
dev.off()
pdf("tmp2.pdf", width=5, height=10)
print(levelplot(m, col=col, aspect="fill",panel= panel.levelplot.raster))
dev.off()
tmp1.pdf has 594 kB and shows the white stripes in Document Viewer,
while tmp2.pdf has 73 kB and does not show white stripes.
Best wishes
Wolfgang
Benoît Ballester scripsit 23/02/11 16:33:
> Hi James,
>
> James W. MacDonald wrote:
>
>> Then zoom in on the resulting pdf. There will be some small white
>> lines, but IMO they are very unobtrusive.
>
> Indeed this is exactly what I see, and I do find it annoying. Have a
> look at the links below. You'll notice the difference between PDF (with
> white lines) and PNG (I believe without)
>
>
> http://tinyurl.com/6yqcswr
> http://tinyurl.com/67wkbl3
>
>
>
>> Your other choice is to use levelplot() from lattice, but you will
>> still get white lines:
>>
>> library(lattice)
>> pdf("tmp2.pdf", width=5, height=50)
>> levelplot(matrix(rnorm(10000), nrow=10), col=redgreen(100),
>> colorkey=FALSE)
>> dev.off()
>>
>
> This seems to work slightly better.
> I'll give it a try...
>
> Ben
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
--
Wolfgang Huber
EMBL
http://www.embl.de/research/units/genome_biology/huber
More information about the Bioconductor
mailing list