[R] Best way of figuring out whether graphical elements overlap?

Johannes Graumann johannes_graumann at web.de
Tue Oct 28 15:42:22 CET 2008


Hi all,

I'm plotting impulses, where some of them should have labels hovering above them. I know of plotrix' spread.labels function, but would like to save that for instances where there truely is to little space for the label.
Does anybody have any hints what' the most efficient way might be to achieve the following:
- plot an impulse plot
- before placing each of a vector of text labels, check (using strhight/width), whether this collides graphically with anything already plotted and only plot it if not.

Thanks for any hints, Joh



More information about the R-help mailing list