alexfang@stat.rutgers.edu
2005-Nov-02 15:07 UTC
[R] For multiple trellis plot, how to add a global title
I use print.trellis() to draw multilple plots in a single frame, but than how could add a global title and subtitle to the final plot. Thank you! eg code: print(position=(0,0,1,0,5), more=T, xyplot(...)) print(position=(0,0.5,1,0,1), more=F, xyplot(...)) ##### Will produce error if I put the following: # title(main="global main title") # title(sub="global sub title") What should I do? thank you! best, Alex
Deepayan Sarkar
2005-Nov-02 19:07 UTC
[R] For multiple trellis plot, how to add a global title
On 11/2/05, alexfang at stat.rutgers.edu <alexfang at stat.rutgers.edu> wrote:> > > I use print.trellis() to draw multilple plots in a single frame, but than > how > could add a global title and subtitle to the final plot. Thank you! > > eg code: > print(position=(0,0,1,0,5), more=T, xyplot(...)) > print(position=(0,0.5,1,0,1), more=F, xyplot(...)) > > ##### Will produce error if I put the following: > # title(main="global main title") > # title(sub="global sub title") > > What should I do? thank you!Use grid.text, e.g. library(grid) grid.text("global main title", x = 0.5, y = 0.99, just = c("centre", "top")) -Deepayan