Skip to content

Commit 5726d87

Browse files
dgromerhadley
authored andcommitted
Examples for plotmath expressions in annotate (#1553)
1 parent dd5e7cf commit 5726d87

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

R/annotation.r

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
#' colour = "red", size = 1.5)
3030
#'
3131
#' p + annotate("text", x = 2:3, y = 20:21, label = c("my label", "label 2"))
32+
#'
33+
#' p + annotate("text", x = 4, y = 25, label = "italic(R) ^ 2 == 0.75",
34+
#' parse = TRUE)
35+
#' p + annotate("text", x = 4, y = 25,
36+
#' label = "paste(italic(R) ^ 2, \" = .75\")", parse = TRUE)
3237
annotate <- function(geom, x = NULL, y = NULL, xmin = NULL, xmax = NULL,
3338
ymin = NULL, ymax = NULL, xend = NULL, yend = NULL, ...,
3439
na.rm = FALSE) {

man/annotate.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)