The R Project SVN R

Rev

Rev 59039 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59039 Rev 61433
Line 12... Line 12...
12
\usage{
12
\usage{
13
roundrectGrob(x=0.5, y=0.5, width=1, height=1,
13
roundrectGrob(x=0.5, y=0.5, width=1, height=1,
14
              default.units="npc",
14
              default.units="npc",
15
              r=unit(0.1, "snpc"),
15
              r=unit(0.1, "snpc"),
16
              just="centre",
16
              just="centre",
17
              name=NULL, gp=NULL, vp=NULL) 
17
              name=NULL, gp=NULL, vp=NULL)
18
grid.roundrect(...) 
18
grid.roundrect(...)
19
}
19
}
20
\arguments{
20
\arguments{
21
  \item{x, y, width, height}{The location and size of the rectangle.}
21
  \item{x, y, width, height}{The location and size of the rectangle.}
22
  \item{default.units}{A string indicating the default units to use
22
  \item{default.units}{A string indicating the default units to use
23
    if \code{x}, \code{y}, \code{width}, or \code{height}
23
    if \code{x}, \code{y}, \code{width}, or \code{height}
24
    are only given as numeric vectors.}  
24
    are only given as numeric vectors.}
25
  \item{r}{The radius of the rounded corners.}
25
  \item{r}{The radius of the rounded corners.}
26
  \item{just}{The justification of the rectangle relative to its
26
  \item{just}{The justification of the rectangle relative to its
27
location.}
27
location.}
28
  \item{name}{A name to identify the grob.}
28
  \item{name}{A name to identify the grob.}
29
  \item{gp}{Graphical parameters to apply to the grob.}
29
  \item{gp}{Graphical parameters to apply to the grob.}
Line 35... Line 35...
35
  rounded rectangle.
35
  rounded rectangle.
36
}
36
}
37
\examples{
37
\examples{
38
grid.roundrect(width=.5, height=.5, name="rr")
38
grid.roundrect(width=.5, height=.5, name="rr")
39
theta <- seq(0, 360, length=50)
39
theta <- seq(0, 360, length=50)
40
for (i in 1:50) 
40
for (i in 1:50)
41
    grid.circle(x=grobX("rr", theta[i]),
41
    grid.circle(x=grobX("rr", theta[i]),
42
                y=grobY("rr", theta[i]),
42
                y=grobY("rr", theta[i]),
43
                r=unit(1, "mm"),
43
                r=unit(1, "mm"),
44
                gp=gpar(fill="black"))
44
                gp=gpar(fill="black"))
45
}
45
}