Learn R Programming

geomtextpath (version 0.1.4)

static_text_params: Set static parameters

Description

This sets parameters for text on a path that aren't expected to change during the construction of a grob.

Usage

static_text_params(
  .type = "text",
  text_only = FALSE,
  gap = NULL,
  upright = TRUE,
  halign = "center",
  offset = NULL,
  parse = FALSE,
  straight = FALSE,
  padding = unit(0.05, "inch"),
  text_smoothing = 0,
  rich = FALSE,
  remove_long = FALSE
)

Value

A list with the parameters.

Arguments

.type

A character(1) with either "text" or "label", which decides what the default is going to be for the gap argument. If "text" the default is NA, which means to dynamically decide. If "label", the "gap" argument should default to FALSE.

text_only

A logical(1) indicating whether the path part should be plotted along with the text (FALSE, the default). If TRUE, any parameters or aesthetics relating to the drawing of the path will be ignored.

gap

A logical(1) which if TRUE, breaks the path into two sections with a gap on either side of the label. If FALSE, the path is plotted as a whole. Alternatively, if NA, the path will be broken if the string has a vjust between 0 and 1, and not otherwise. The default for the label variant is FALSE and for the text variant is NA.

upright

A logical(1) which if TRUE (default), inverts any text where the majority of letters would upside down along the path, to improve legibility. If FALSE, the path decides the orientation of text.

halign

A character(1) describing how multi-line text should be justified. Can either be "center" (default), "left" or "right".

offset

A unit object of length 1 to determine the offset of the text from the path. If this is NULL (default), the vjust parameter decides the offset. If not NULL, the offset argument overrules the vjust setting.

parse

A logical(1) which if TRUE, will coerce the labels into expressions, allowing for plotmath syntax to be used.

straight

A logical(1) which if TRUE, keeps the letters of a label on a straight baseline and if FALSE (default), lets individual letters follow the curve. This might be helpful for noisy paths.

padding

A unit object of length 1 to determine the padding between the text and the path when the gap parameter trims the path.

text_smoothing

a numeric(1) value between 0 and 100 that smooths the text without affecting the line portion of the geom. The default value of 0 means no smoothing is applied.

rich

A logical(1) whether to interpret the text as html/markdown formatted rich text. Default: FALSE. See also the rich text section of the details in geom_textpath().

remove_long

if TRUE, labels that are longer than their associated path will be removed.