Maja Schröter wrote:
> Hi everybody,
>
> I want to write some text in a plot.
>
> That's simple I know. But I want to make use of different colors.
>
> Eg. text(x,y,paste("Sunderland","high")).
>
> Then Sunderland should be black and "high" red.
>
> Has anyone an idea?
>
> By the way. I'm looking for a function or something similar, that can check
> whether there is text in some regions on the plot.
> Because I don't want to overwrite an existing text with a new one.
>
Hi Maja,
For your first question:
text(c(9,9),c(5,5),c("Sunderland","high"),
pos=c(2,4),offset=0.2,col=c("black","red"))
i.e., don't form a single string so that you can specify different
colors and positions for the two words.
For the second one, I am about to upload a new version of the plotrix
package that contains a function named "emptyspace". This tries to find
the largest rectangle on a plot that has nothing plotted within it.
Jim
______________________________________________
[email protected] 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.