Re: [R] Labelling certain points on the x-axis

2007-08-20 Thread Uwe Ligges


squall44 wrote:
> Hello,
> 
> I created an empirical distribution function:
> 
> x = c(1.6,1.8,2.4,2.7,2.9,3.3,3.4,3.4,4,5.2)
> F2.5 <- ecdf(x)
> plot(F2.5, 
>  verticals= TRUE, 
>  do.p = TRUE, 
>  lwd=3, 
>  ylab = "f(x)", 
>  xlab = "x", 
>  main = "Figur 2.5 Empirische Verteilfunktion", 
>  xlim = c(1,5.5))
> abline(h= (0:5)*0.2)

See ?mtext for adding text into the margins.

Uwe Ligges



> Now I would like to label the points on the x-axis where there is an
> x-value:
> 
> http://www.nabble.com/file/p12231344/figur.gif 
> 
> I don't know how to do that... can anyone help me?
> Thanks

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Labelling certain points on the x-axis

2007-08-20 Thread Jim Lemon
squall44 wrote:
> Hello,
> 
> I created an empirical distribution function:
> 
> x = c(1.6,1.8,2.4,2.7,2.9,3.3,3.4,3.4,4,5.2)
> F2.5 <- ecdf(x)
> plot(F2.5, 
>  verticals= TRUE, 
>  do.p = TRUE, 
>  lwd=3, 
>  ylab = "f(x)", 
>  xlab = "x", 
>  main = "Figur 2.5 Empirische Verteilfunktion", 
>  xlim = c(1,5.5))
> abline(h= (0:5)*0.2)
> 
> Now I would like to label the points on the x-axis where there is an
> x-value:

Given that you have two labels at the same point, you will have to 
stretch out your labels. I took out the X axis label to get enough room.

library(plotrix)
plot(F2.5,
  verticals= TRUE,
  do.p = TRUE,
  lwd=3,
  ylab = "f(x)",
  xlab = "",
  main = "Figur 2.5 Empirische Verteilfunktion",
  xlim = c(1,5.5))
abline(h= (0:5)*0.2)
staxlab(at=x,labels=paste("X[",1:10,"]",sep=""),nlines=3,top.line=2)

Jim

__
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
and provide commented, minimal, self-contained, reproducible code.