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: http://www.nabble.com/file/p12231344/figur.gif I don't know how to do that... can anyone help me? Thanks -- View this message in context: http://www.nabble.com/Labelling-certain-points-on-the-x-axis-tf4297126.html#a12231344 Sent from the R help mailing list archive at Nabble.com.
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
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