Skip to content
Prev 279644 / 398506 Next

adding hyperlinked text to pdf plot

Hi Justin,

It sounds like you might be able to use the 'hyperplot()' function (in 
the 'caroline' package) for creating an html imagemap around your 
figure.  This is assuming all that you want to do is interactivate a 
2-dimensional scatter plot.  You'd also lose PDF-pagination but the 
auto-tabbing of most browsers from each independent hyperplot() call 
should help you stay organized.

Say you use hyperplot() like so:

----------------------------------------------------------------
library(caroline)

chr1 <- data.frame(pos=1:1000, cov=rnorm(1000,10,1), 
url=paste('http://my.genome.org/id=',1:1000,sep=''))
hyperplot(x='pos',y='cov', annout=chr1, link='url',
           xlab='position', ylab='coverage')

chr2 <- data.frame(pos=1:1000, cov=rnorm(1000,10,1), 
url=paste('http://my.genome.org/id=',1:1000,sep=''))
hyperplot(x='pos',y='cov', annout=chr2, link='url',
           xlab='position', ylab='coverage')
#chr3 <-
#...etc...
----------------------------------------------------------------

With this approach you'd have each chromosome on a different tab.

Cheers,

Dave
On 12/5/2011 12:20 PM, Yihui Xie wrote: