| Line 9... |
Line 9... |
| 9 |
\title{Draw Text}
|
9 |
\title{Draw Text}
|
| 10 |
\description{
|
10 |
\description{
|
| 11 |
These functions create and draw text and \link{plotmath} expressions.
|
11 |
These functions create and draw text and \link{plotmath} expressions.
|
| 12 |
}
|
12 |
}
|
| 13 |
\usage{
|
13 |
\usage{
|
| 14 |
grid.text(label, x = unit(0.5, "npc"), y = unit(0.5, "npc"),
|
14 |
grid.text(label, x = unit(0.5, "npc"), y = unit(0.5, "npc"),
|
| 15 |
just = "centre", hjust = NULL, vjust = NULL, rot = 0,
|
15 |
just = "centre", hjust = NULL, vjust = NULL, rot = 0,
|
| 16 |
check.overlap = FALSE, default.units = "npc",
|
16 |
check.overlap = FALSE, default.units = "npc",
|
| 17 |
name = NULL, gp = gpar(), draw = TRUE, vp = NULL)
|
17 |
name = NULL, gp = gpar(), draw = TRUE, vp = NULL)
|
| 18 |
|
18 |
|
| 19 |
textGrob(label, x = unit(0.5, "npc"), y = unit(0.5, "npc"),
|
19 |
textGrob(label, x = unit(0.5, "npc"), y = unit(0.5, "npc"),
|
| 20 |
just = "centre", hjust = NULL, vjust = NULL, rot = 0,
|
20 |
just = "centre", hjust = NULL, vjust = NULL, rot = 0,
|
| 21 |
check.overlap = FALSE, default.units = "npc",
|
21 |
check.overlap = FALSE, default.units = "npc",
|
| 22 |
name = NULL, gp = gpar(), vp = NULL)
|
22 |
name = NULL, gp = gpar(), vp = NULL)
|
| 23 |
}
|
23 |
}
|
| 24 |
\arguments{
|
24 |
\arguments{
|
| 25 |
\item{label}{A character or \link{expression} vector. Other
|
25 |
\item{label}{A character or \link{expression} vector. Other
|
| 26 |
objects are coerced by \code{\link{as.graphicsAnnot}}.}
|
26 |
objects are coerced by \code{\link{as.graphicsAnnot}}.}
|
| 27 |
\item{x}{A numeric vector or unit object specifying x-values.}
|
27 |
\item{x}{A numeric vector or unit object specifying x-values.}
|
| 28 |
\item{y}{A numeric vector or unit object specifying y-values.}
|
28 |
\item{y}{A numeric vector or unit object specifying y-values.}
|
| 29 |
\item{just}{The justification of the text
|
29 |
\item{just}{The justification of the text
|
| 30 |
relative to its (x, y) location. If there are two values, the first
|
30 |
relative to its (x, y) location. If there are two values, the first
|
| 31 |
value specifies horizontal justification and the second value specifies
|
31 |
value specifies horizontal justification and the second value specifies
|
| 32 |
vertical justification. Possible string values are: \code{"left"},
|
32 |
vertical justification. Possible string values are: \code{"left"},
|
| 33 |
\code{"right"}, \code{"centre"}, \code{"center"}, \code{"bottom"},
|
33 |
\code{"right"}, \code{"centre"}, \code{"center"}, \code{"bottom"},
|
| 34 |
and \code{"top"}. For numeric values, 0 means left alignment
|
34 |
and \code{"top"}. For numeric values, 0 means left alignment
|
| Line 41... |
Line 41... |
| 41 |
\item{rot}{The angle to rotate the text.}
|
41 |
\item{rot}{The angle to rotate the text.}
|
| 42 |
\item{check.overlap}{A logical value to indicate whether to
|
42 |
\item{check.overlap}{A logical value to indicate whether to
|
| 43 |
check for and omit overlapping text.}
|
43 |
check for and omit overlapping text.}
|
| 44 |
\item{default.units}{A string indicating the default units to use
|
44 |
\item{default.units}{A string indicating the default units to use
|
| 45 |
if \code{x} or \code{y}
|
45 |
if \code{x} or \code{y}
|
| 46 |
are only given as numeric vectors.}
|
46 |
are only given as numeric vectors.}
|
| 47 |
\item{name}{ A character identifier. }
|
47 |
\item{name}{ A character identifier. }
|
| 48 |
\item{gp}{An object of class \code{gpar}, typically the output
|
48 |
\item{gp}{An object of class \code{gpar}, typically the output
|
| 49 |
from a call to the function \code{gpar}. This is basically
|
49 |
from a call to the function \code{gpar}. This is basically
|
| 50 |
a list of graphical parameter settings.}
|
50 |
a list of graphical parameter settings.}
|
| 51 |
\item{draw}{A logical value indicating whether graphics output
|
51 |
\item{draw}{A logical value indicating whether graphics output
|
| Line 54... |
Line 54... |
| 54 |
}
|
54 |
}
|
| 55 |
\details{
|
55 |
\details{
|
| 56 |
Both functions create a text grob (a graphical object describing
|
56 |
Both functions create a text grob (a graphical object describing
|
| 57 |
text), but only \code{grid.text}
|
57 |
text), but only \code{grid.text}
|
| 58 |
draws the text (and then only if \code{draw} is \code{TRUE}).
|
58 |
draws the text (and then only if \code{draw} is \code{TRUE}).
|
| 59 |
|
59 |
|
| 60 |
If the \code{label} argument is an expression, the output is
|
60 |
If the \code{label} argument is an expression, the output is
|
| 61 |
formatted as a mathematical annotation, as for base graphics text.
|
61 |
formatted as a mathematical annotation, as for base graphics text.
|
| 62 |
|
62 |
|
| 63 |
}
|
63 |
}
|
| 64 |
\value{
|
64 |
\value{
|
| 65 |
A text grob. \code{grid.text} returns the value invisibly.
|
65 |
A text grob. \code{grid.text} returns the value invisibly.
|
| 66 |
}
|
66 |
}
|
| 67 |
\author{Paul Murrell}
|
67 |
\author{Paul Murrell}
|