| Line 1... |
Line 1... |
| 1 |
% File src/library/grid/man/grid.text.Rd
|
1 |
% File src/library/grid/man/grid.text.Rd
|
| 2 |
% Part of the R package, https://www.R-project.org
|
2 |
% Part of the R package, https://www.R-project.org
|
| 3 |
% Copyright 1995-2020 R Core Team
|
3 |
% Copyright 1995-2022 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{grid.text}
|
6 |
\name{grid.text}
|
| 7 |
\alias{grid.text}
|
7 |
\alias{grid.text}
|
| 8 |
\alias{textGrob}
|
8 |
\alias{textGrob}
|
| Line 38... |
Line 38... |
| 38 |
If specified, overrides the \code{just} setting.}
|
38 |
If specified, overrides the \code{just} setting.}
|
| 39 |
\item{vjust}{A numeric vector specifying vertical justification.
|
39 |
\item{vjust}{A numeric vector specifying vertical justification.
|
| 40 |
If specified, overrides the \code{just} setting.}
|
40 |
If specified, overrides the \code{just} setting.}
|
| 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 (within that grob).}
|
| 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
|
| Line 77... |
Line 77... |
| 77 |
rot <- stats::runif(20, 0, 360)
|
77 |
rot <- stats::runif(20, 0, 360)
|
| 78 |
grid.text("SOMETHING NICE AND BIG", x=x, y=y, rot=rot,
|
78 |
grid.text("SOMETHING NICE AND BIG", x=x, y=y, rot=rot,
|
| 79 |
gp=gpar(fontsize=20, col="grey"))
|
79 |
gp=gpar(fontsize=20, col="grey"))
|
| 80 |
grid.text("SOMETHING NICE AND BIG", x=x, y=y, rot=rot,
|
80 |
grid.text("SOMETHING NICE AND BIG", x=x, y=y, rot=rot,
|
| 81 |
gp=gpar(fontsize=20), check.overlap=TRUE)
|
81 |
gp=gpar(fontsize=20), check.overlap=TRUE)
|
| - |
|
82 |
|
| - |
|
83 |
grid.newpage() ## plotmath example
|
| - |
|
84 |
grid.text(quote(frac(e^{-x^2/2}, sqrt(2*pi))), x=x, y=y, rot=stats::runif(20, -45,45),
|
| - |
|
85 |
gp=gpar(fontsize=17, col=4), check.overlap=TRUE)
|
| - |
|
86 |
|
| 82 |
grid.newpage()
|
87 |
grid.newpage()
|
| 83 |
draw.text <- function(just, i, j) {
|
88 |
draw.text <- function(just, i, j) {
|
| 84 |
grid.text("ABCD", x=x[j], y=y[i], just=just)
|
89 |
grid.text("ABCD", x=x[j], y=y[i], just=just)
|
| 85 |
grid.text(deparse(substitute(just)), x=x[j], y=y[i] + unit(2, "lines"),
|
90 |
grid.text(deparse(substitute(just)), x=x[j], y=y[i] + unit(2, "lines"),
|
| 86 |
gp=gpar(col="grey", fontsize=8))
|
91 |
gp=gpar(col="grey", fontsize=8))
|