View source: R/plot_text_calls.R
post | R Documentation |
post
plots 1 or more text strings (provided as a character vector labels
)
to an (existing or new) xbox
.
post(
labels,
x = 0.03,
y = 0.55,
x_layout = NA,
y_layout = "even",
col = "white",
col_bg = Seeblau,
cex = 1,
font = 1,
new_plot = "none"
)
labels |
A character vector specifying the text labels to be plotted. |
x |
A numeric vector of x-coordinates at which the
text labels in |
y |
A numeric vector of y-coordinates at which the
text labels in |
x_layout |
An optional numeric vector or character string
to control the horizontal positions of |
y_layout |
A numeric value or character string
to control the vertical positions of |
col |
The color(s) of the text label(s).
Default: |
col_bg |
The background color(s) of the |
cex |
Numeric character expansion factor(s),
multiplied by |
font |
The font type(s) to be used.
Default: |
new_plot |
Should a new plot be generated?
Set to |
The positions of the text elements in labels
can be specified by
providing their coordinates (as x
and y
arguments) or
by providing an initial position and an y_layout
(see below).
Text formatting parameters (like col
, col_bg
, cex
, font
)
are recycled to match length(labels)
.
post
uses the base graphics system graphics::
.
xbox
to create a new xbox (without text).
Other text functions:
mark()
,
uline()
,
url_unikn()
# Create a new xbox:
post(labels = "This is a test.", new_plot = "xbox",
cex = 1.2, font = 2, col_bg = pal_seeblau[[5]])
# Add text to an existing xbox:
post(labels = c("More text follows here,",
"yet another line here,",
"and even more here."),
y = .4, y_layout = .04,
new_plot = "none")
# Using x_layout and y_layout:
post(labels = c("Ene,", "mene, miste,", "es rappelt", "in der Kiste."),
cex = 1.4, font = 2, col = "white", col_bg = Pinky,
x = .1, y = .5, x_layout = "left", y_layout = .05, new_plot = "xbox")
post(labels = c("Hello world!", "Does this work?", "That's good!", "Please carry on..."),
cex = 1.4, font = 2, col = "white", col_bg = Karpfenblau,
x = .01, y = .6, x_layout = .10, y_layout = .05, new_plot = "xbox")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.