-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathrect.Rd
More file actions
52 lines (49 loc) · 1.86 KB
/
rect.Rd
File metadata and controls
52 lines (49 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/rect.R
\name{rect}
\alias{rect}
\title{gsplot rect}
\usage{
rect(object, ...)
}
\arguments{
\item{object}{gsplot object}
\item{\dots}{Further graphical parameters may also be supplied as arguments. See 'Details'.}
}
\description{
Add single or multiple rectangles to the plotting region. See \code{\link[graphics]{rect}} for more details.
}
\details{
Additional graphical parameter inputs:
\itemize{
\item{\code{xleft}} {vector or scalar indicating left positions on the x-axis}
\item{\code{xright}} {vector or scalar indicating right positions on the x-axis}
\item{\code{ybottom}} {vector or scalar indicating bottom positions on the y-axis}
\item{\code{ytop}} {vector or scalar indicating top positions on the y-axis}
\item{\code{density}} {density of shading lines (lines per inch), NULL means no shading, NA suppresses shading and allows color fill}
\item{\code{angle}} {angle of shading lines (degrees)}
\item{\code{col}} {shade or fill color(s), NA means no fill (transparent)}
\item{\code{border}} {color of border, NA means no border, TRUE indicates the same color as shading lines}
\item{\code{lty}} {line type for borders and shading}
\item{\code{lwd}} {line width for borders and shading}
}
}
\examples{
gs <- gsplot() \%>\%
points(x=c(1:5, 3.5), y=c(1:5, 6), legend.name="Stuff") \%>\%
lines(x=2:6, y=2:6, ylim=c(0,10)) \%>\%
axis(side=c(1,2),labels=TRUE) \%>\%
legend("topright") \%>\%
rect(xleft=3.4, xright=3.6, ybottom=5,
ytop=7, density=NULL, border='purple',
lty=2, lwd=3)
gs
gs <- gsplot() \%>\%
lines(x=10:20, y=c(10:15, 25, 17:20),
xlim=c(0,30), ylim=c(0,30), col='darkgreen',
legend.name="Some data") \%>\%
rect(xleft=15, xright=17, ybottom=21, ytop=27,
density=10, angle=130, col='darkblue') \%>\%
legend()
gs
}