[R] possible to plot number line in R?

Jim Lemon jim at bitwrit.com.au
Thu Jul 1 14:15:59 CEST 2010


On 07/01/2010 09:18 PM, Kroepfl, Julia (julia.kroepfl at 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



More information about the R-help mailing list