Created
June 14, 2019 22:16
Revisions
-
andrewheiss revised this gist
Jun 14, 2019 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,5 @@ ``` r library(tidyverse) # See https://stackoverflow.com/a/17313561/120898 pts <- function(x) { -
andrewheiss created this gist
Jun 14, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ ``` r library(tidyverse) #> Registered S3 methods overwritten by 'ggplot2': #> method from #> [.quosures rlang #> c.quosures rlang #> print.quosures rlang # See https://stackoverflow.com/a/17313561/120898 pts <- function(x) { as.numeric(grid::convertUnit(grid::unit(x, "pt"), "mm")) } df <- tibble(x = 1:10, y = 1:10) ggplot(df, aes(x = x, y = y)) + geom_point() + annotate(geom = "text", x = 2, y = 5, label = "I'm 10 points", size = pts(10)) + annotate(geom = "text", x = 2, y = 8, label = "I'm 5 points", size = pts(5)) ```  <sup>Created on 2019-06-14 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup>