[BioC] Help with creating a figure
Steve Lianoglou
mailinglist.honeypot at gmail.com
Tue Jun 17 21:09:47 CEST 2008
Hi,
I'm trying to recreate a figure from a publication[1] that looks like
this:
http://cbio.mskcc.org/~lianos/images/barfig.png
I have some vectors with "scores" (that you see is plotted
horizontally there) that I'd just like to turn into some colored
representation/heatmap like that. I'd also like to then display the
legend of the heatmap on the right there. It would be great if we can
add the labels too, but if it's overkill to do, then I'll deal without
them.
I have code that is my crude attempt at plotting on of those bars, but
I think I'm going about it the wrong way. I'm also at a loss at
finding the magic incantation is to get the colorbar up on the side
(the equivalent to MATLAB's `colorbar` call[2], I guess).
nboxes <-length(scores)
cp <- colorRampPalette(c('darkblue', 'darkred'))(30)
plot(1, 1, xlim=c(0, 50), ylim=c(-1,1), type="n", axes=FALSE, bty="n",
xlab=names(scores), ylab="")
rect(xlef=0:nboxes, ybottom=1, xright=(0:nboxes)+1, ytop=1.8,
col=cp[1:nboxes], border='light grey')
I looked trough the R graphics gallery[3] to see if I could find
something similar, but I'm not finding anything that's helping ...
Some code examples would be great, but some general pointers to places
I should be looking into would also be a big help.
Thanks,
-steve
[1] Bild et al. Oncogenic pathway signatures in human cancers as a
guide to targeted, Nature 2006.
[2] http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/colorbar.html
[3] http://addictedtor.free.fr/graphiques/
--
Steve Lianoglou
Graduate Student: Physiology, Biophysics, and Systems Biology
Weill Medical College, Cornell University
http://cbio.mskcc.org/~lianos
More information about the Bioconductor
mailing list