tags:

views:

136

answers:

2

I'm trying to add a title at the top of the page scatterplots, however whenever I use the command title it doesn't add the title at the top of page and overwrites my plots. Is there a way to fix this ?

plot(median, pch = ".")
title(main = "Scatterplot of the median vectors ",line = 0,font=2)
+3  A: 

There is no reason your code should not work as is. It works for me just fine. Are you attempting to do something more than the example code you gave?

Is there a reason not to just use plot(median, pch = ".", main = "Foo")?

JAShapiro
somehow this code works much better ,looks like I got alot to learn haha
Rbuilder
+2  A: 

Did you look at the mtext() command? Did you look at the par(oma=c(...)) option? Try something like

oldpar <- par(oma=c(0,0,2,0), mar=c(3,3,3,1), mfrow=c(1,2))
plot(cumsum(rnorm(1:100)), main="First plot", type='l')
plot(cumsum(rnorm(1:100)), main="Second plot", type='l')
mtext("Overall title", outer=TRUE, cex=1.5)
par(oldpar)
Dirk Eddelbuettel
hey this method works well , Im quite curious what do the parameters oma , mar and mfrow stand for ?
Rbuilder
They set, respectively, the outer margin (2 lines at the top) and plot margin (3 at bottom, left and top, 1 at right) and the one row, two columns layout. But you really want to look at help(par), and as it is a pretty long help page, maybe an introductory book like Dalgaard's as par() is a very useful function to know.
Dirk Eddelbuettel