On 7/10/2007 10:36 AM, livia wrote: > Hi all, > > I would like to plot part of the emperical CDF. Suppose the variable is x, I > just need the part when x>1,therefore, I am using the following codes. > > tail <- x>1 > plot(ecdf(x[tail]), do.points=FALSE, verticals=TRUE) > > The "x" value starts from 1, but the yaxs still begins from 0, not the > corresponding value when "x" is 1. How can I make it match? > > Could anyone give me some advice? Many thanks.
Rather than subsetting the x, I'd just use xlim and ylim arguments to plot() to change the range. For example, plot(ecdf(x), do.points=FALSE, verticals=TRUE, xlim=c(1, max(x)), ylim=c(1-sum(x>1)/length(x), 1)) Duncan Murdoch ______________________________________________ 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.