On 07/01/2010 09:18 PM, Kroepfl, Julia (julia.kroe...@uni-graz.at) wrote:
Hallo!

Is there a possibility to plot a number line in R?
I would like to display 3 different Intervals on the same number line. Ideally, 
it would be possible to add a name to each number (e.g. Interval 1, lower 
cut-off...and so on). I have not found a command for this.

Hi Julia,
I had to do a tweak on the spread.labels function (attached). Try this:

library(plotrix)
source("spread.labels.R")
plot(0:100,axes=FALSE,type="n",xlab="",ylab="")
axis(1,pos=0)
spread.labels(c(5,20,50,60,70,90),rep(0,6),ony=FALSE,
 labels=c("Bottom1","Top1","Bottom2","Top2","Bottom3","Top3"),
 offsets=rep(20,6))

Jim

______________________________________________
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.

Reply via email to