Entering edit mode
k. brand
▴
420
@k-brand-1874
Last seen 10.3 years ago
Esteemed BioC Users,
In pursuit of a simple method to adjust the "contrast" of a heatmap i
attempted to use the image() argument "zlim" in heatmap.2, both
directly
and using add.expr. These attempts failed (shown below on my example
heatmap.2).
heatplot() from library(made4) includes just such a convenient zlim=
argument, but for now i'd trying to use heatmap.2 for all my heatmap
needs. For the record, i can achieve what a zlim adjustment using the
breaks argument to specify the effective range of zlim, but specifying
breaks interferes with the scale argument in heatmap.2. So no good.
So any suggestions for a zlim adjustment in heatmap.2 are greatly
appreciated, cheers,
Karl
#example
toy.mat <- matrix(rnorm(1000), nrow=100, ncol=10)
library(gplots)
windows()
plot.new()
heatmap.2(toy.mat,
Rowv=T, Colv=T,
dendrogram="column",
scale= "row",
col=c(greenred(256)),
# breaks = c(seq(-10, 10, length.out = 257)),#interferes with 'scale'
trace="none",
density.info="none",
zlim=c(-10, 10) #no error, but no effect
# add.expr = (zlim=c(-10, 10)) #no error, but no effect
# add.expr = "zlim", zlim=c(-10, 10) #no error, but no effect
# add.expr = zlim, zlim=c(-10, 10) #produces error
)
#end
--
Karl Brand <k.brand at="" erasmusmc.nl="">
Department of Genetics
Erasmus MC
Dr Molewaterplein 50
3015 GE Rotterdam
P +31 (0)10 704 3409 | F +31 (0)10 704 4743 | M +31 (0)642 777 268