Description Usage Arguments Details Examples
Adjust text srt (rotation) to get readable directions
1 | harmonize_text_srt(a, ortho = FALSE)
|
a |
Vector of angles (anti-clockwise). |
ortho |
Rotate so text is orthogonal to the axis? |
srt values are mapped as follows: 0 to 90 = keep, 271 to 260 = keep, 91 to 270 = add 180 degrees.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | srt <- round(seq(0, 360, length=10)) # some angles
# plot text with standard rotation
plot(srt, rep(0, 10), type="n")
for (i in seq_along(srt))
text(srt[i], .5, label=srt[i], srt=srt[i])
# all labels in readable direction
hsrt <- harmonize_text_srt(srt)
for (i in seq_along(srt))
text(srt[i], 0, label=srt[i], srt=hsrt[i])
# all labels in readable direction but orthogonal to the ones before
hsrt <- harmonize_text_srt(srt, ortho = TRUE) # harmonize rotation
for (i in seq_along(srt))
text(srt[i],-.5, label=srt[i], srt=hsrt[i])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.