
Erik,
 
To add to what epter said...
I created this little function for clicking text anywhere on the plot (I probably stole the idea from a list serve or Dalgaard's book or someplace like that).  Anyway it is helpful to me and may be of use to you too.  Very basic but I use it a ton.  You modify to suit your needs.
 
#TEXT CLICK FUNCTION
textClick<-function(express,col="black",cex=NULL){
par(mar = rep(0, 4),xpd=NA)
text(locator(1),express,col=col,cex=cex)
}
 
#EXAMPLE
frame()
par(mfrow=c(2,2))
with(mtcars,plot(mpg~cyl));with(mtcars,plot(mpg~cyl))
with(mtcars,plot(mpg~cyl));with(mtcars,plot(mpg~cyl))
textClick(expression(sum((bar(X)-X^2))),"pink",.5)
 
Cheers
Tyler
 
> Date: Mon, 6 Jun 2011 15:09:29 -0700
> From: ehlers@ucalgary.ca
> To: erik@q32.com
> CC: r-help@r-project.org
> Subject: Re: [R] draw text outside plot boundaries
> 
> On 2011-06-06 08:44, Erik Aronesty wrote:
> > i'd like to use the text() function to annotate some points, but the
> > labels get cropped, if the point is on the right
> >
> > is there a way to prevent this, and tell the text() function to allow
> > writing outside the boundaries of the current plot?
> 
> Go to ?par and check out the 'xpd' parameter.
> 
> Peter Ehlers
> 
> >
> > i don't mind if it looks "messy" and steps on the margin a bit.
> >
> > - erik
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
 		 	   		  
	[[alternative HTML version deleted]]

