click_text: Add text interactively in base 'R' graphics

View source: R/plot_extra.R

click_textR Documentation

Add text interactively in base R graphics

Description

Add text and expressions anywhere in a plot (including margins) with mouse click(s).

Usage

click_text(expr, ...)

Arguments

expr

a character string of text or an expression

...

additional graphical parameters passed to text (or par) such as col, srt, family, etc

Value

(Invisibly) a vector of length two with the x- and y-coordinates of the text.

See Also

click_shape; plotmath for help with plotting mathematical expressions

Examples

## Not run: 
plot.new()
click_text('hello', col = 'red', cex = .5)
click_text('goodbye', family = 'HersheyScript', cex = 3)
click_text(expression(sum(x ^ 2) == 5 ^ hat(x)), srt = 45)

## End(Not run)


raredd/plotr documentation built on Nov. 19, 2023, 4:09 a.m.