Debian Codegraph @

man/plotStep.Rd

raw
1 % Originally /u/maechler/S/GRAPHICS/plot.step.d,v 1.2 1997/05/27 10:17:27
2 % Copyright (c), 1991, 1997 Martin Maechler, Statistik, ETH Zurich
3 % Martin Maechler <[email protected]>
4 \name{plotStep}
5 \alias{plotStep}
6 \title{Plot a Step Function}
7 \description{
8 Plots a step function
9 f(x)= \eqn{\sum_i y_i 1_[ t_{i-1}, t_i ](x) }{sum(i; y[i] *
10 Ind[t[i-1], t[i])(x))}, i.e., a piecewise constant function of one variable.
11 With one argument, plots \bold{the} empirical cumulative distribution
12 function.
13 }
14 \usage{
15 plotStep(ti, y,
16 cad.lag = TRUE,
17 verticals = !cad.lag,
18 left.points= cad.lag, right.points= FALSE, end.points= FALSE,
19 add = FALSE,
20 pch = par('pch'),
21 xlab=deparse(substitute(ti)), ylab=deparse(substitute(y)),
22 main=NULL, \dots)
23 }
24 \arguments{
25 \item{ti}{numeric vector = \code{X[1:N]} or \code{t[0:n]}.}
26 \item{y}{numeric vector \code{y[1:n]}; if omitted take y = k/N
27 for empirical CDF.}
28 \item{cad.lag}{logical: Draw 'cad.lag', i.e., \dQuote{\emph{continue à
29 droite, limite à gauche}}. Default = TRUE.}
30 \item{verticals}{logical: Draw vertical lines? Default= \code{! cad.lag}}
31 \item{left.points}{logical: Draw left points? Default= \code{cad.lag}}
32 \item{right.points}{logical: Draw right points? Default= \code{FALSE}}
33 \item{end.points}{logical: Draw 2 end points? Default= \code{FALSE}}
34 \item{add}{logical: Add to existing plot? Default= \code{FALSE}}
35 \item{pch}{plotting character for points, see \code{\link{par}()}.}
36 \item{xlab,ylab}{labels of x- and y-axis}
37 \item{main}{main title; defaults to the call' if you do not want a title,
38 use \code{main = ""}.}
39 \item{\dots}{Any valid argument to \code{\link{plot}(..)}.}
40 }
41 \value{
42 \bold{invisibly}: List with components \code{t} and \code{y}.
43 }
44 \section{Side Effects}{
45 Calls plot(..), points(..), segments(..) appropriately
46 and plots on current graphics device.
47 }
48 \author{Martin Maechler, Seminar for Statistics, ETH Zurich,
49 \email{[email protected]}, 1991 ff.
50 }
51 \seealso{
52 The \code{\link{plot}} methods \code{\link{plot.ecdf}} and
53 \code{\link{plot.stepfun}} in \R which are conceptually nicer.
54
55 \code{\link{segments}(\dots, method = "constant")}.
56 }
57 \examples{
58 ##-- Draw an Empirical CDF (and see the default title ..)
59 plotStep(rnorm(15))
60
61 plotStep(runif(25), cad.lag=FALSE)
62 plotStep(runif(25), cad.lag=FALSE, add=TRUE, lty = 2)
63
64 ui <- sort(runif(20))
65 plotStep(ui, ni <- cumsum(rpois(19, lambda=1.5) - 1.5), cad.lag = FALSE)
66 plotStep(ui, ni, verticals = TRUE, right.points = TRUE)
67
68 plotStep(rnorm(201), pch = '.') #- smaller points
69 }
70 \keyword{nonparametric}
71 \keyword{hplot}