library(grid)
g <- textGrob(
label = c("1", "2", "3"),
gp = gpar(
fontsize = 1:3 * 50,
cex = 1,
fontfamily = "",
fontface = "plain",
col = ggplot2::alpha(c("black", "red"), 0.5)
)
)
grid.newpage()
grid.draw(g)
g$x <- unit(c(0.5, 0.5), "npc")
grid.newpage()
grid.draw(g)
g$x <- unit(1:6 * 0.05 + 0.2, "npc")
g$y <- unit(1:6 * 0.05 + 0.2, "npc")
grid.newpage()
grid.draw(g)
Created on 2019-08-20 by the reprex package (v0.3.0)