Re: [R] text bubble (rectangle)?

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Sun 04 Jun 2006 - 17:43:05 EST

"ivo welch" <ivowel@gmail.com> writes:

> Dear R wizards: sorry to bug everyone twice in one day.
>
> I would like to annotate my graph by putting text strings into
> rectangle boxes with a little cartoon-like bubble with a lid pointing
> to a specific location. I can draw some sort of bubble-with-lid using
> the R primitives. (has anyone done something like this already?)
>
> the problem where I am stuck is that the width of the rectangle must
> depend on the length and font of my string. is there a way to obtain
> the lower left and upper right location of a text string that R drew?
> (this would be good return values for the text() function, wouldn't
> it?)
>
> bubble.annotate <- function( x, y, xlid, ylid, textstring ) { HELP }
> bubble.annotate( 19871010, 20, 19871019, 13, "Black Monday" );
>
> [and thanks, gabor, for explaining the ifelse tricks with dates to me.]

Have a look at strwidth/strheight.

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sun Jun 04 17:48:28 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 04 Jun 2006 - 20:10:28 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.