text_rot: Plot text rotated depending angle to x-axis

Description Usage Arguments Examples

View source: R/text.R

Description

Plot text rotated depending angle to x-axis

Usage

1
text_rot(x, y = NULL, label, ...)

Arguments

x

numeric vectors of coordinates where the text labels should be written. If the length of x and y differs, the shorter one is recycled.

...

further graphical parameters (from par), such as srt, family and xpd.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# text automatically rotated with resp<c3><bc>ect to x-axis

lim <- c(-1.5,1.5)
plot(NULL, asp=1, xlim=lim, ylim=lim)
plotrix::draw.circle(0, 0, 1)
s <- 1.05
phis <- seq(0, 2*pi, by=.4)
for (phi in phis) {
  v <- c(cos(phi), sin(phi))
  segments(0,0, v[1], v[2])
  text_rot(v * 1.1, label=phi)
}

markheckmann/circplot documentation built on May 21, 2019, 12:06 p.m.