[R] Text Outside Lattice Plot

jimdare jamesdare26 at gmail.com
Wed Jan 21 02:55:53 CET 2009


Dear R users

I created the graph at the bottom using xyplot in the lattice package.  I
added a title using the main="Title"  command in xyplot, however it is
plotted too close to the legend for my liking.  To remedy this I increased
the upper margin of the plot using plot(data, position = c(0,0,1,.9)) and
attempted to move "SNA" upwards and to the right.  I have tried using a
variety of text functions such as:

trellis.focus("panel", 1, 1) 
panel.text(x=11, y=100000, labels="SNA") 
trellis.unfocus() 

panel.xyplot(...) 
panel.text(x=11, y=100000, labels="SNA") 

library(grid) 
ltext(grid.locator(), label='SNA') 

The first two of these functions work but the text disappears once I specify
a y coordinate > ymax.  The last function appears to work but requires me to
click on the plot to specify the location (I need this to be pre-defined). 
Does anyone know how I can do this?

Regards,
James
http://www.nabble.com/file/p21575690/SNA.gif 
-- 
View this message in context: http://www.nabble.com/Text-Outside-Lattice-Plot-tp21575690p21575690.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list