click_text: Add text interactively in base 'R' graphics

Description Usage Arguments Value See Also Examples

View source: R/plot_extra.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
## 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. 13, 2018, 7:05 a.m.