Skip to content

Instantly share code, notes, and snippets.

@baptiste
Created October 19, 2020 00:01
Show Gist options
  • Save baptiste/3c0dd731bcf88bc83621d810bb11e8f3 to your computer and use it in GitHub Desktop.
Save baptiste/3c0dd731bcf88bc83621d810bb11e8f3 to your computer and use it in GitHub Desktop.
library(vwline)
library(gridGeometry)
library(hershey)
library(ggplot2)
library(scales)
w <- c(0, .2, 0)
gl <- list()
for (ii in 1:26){
txt <- letters[ii]
st <- create_string_df(txt, font = "cursive")
gl[[ii]] <- gTree(children=gList(brushXsplineGrob(verticalBrush, rescale(st$x, c(0.1,0.9)) ,
rescale(st$y, c(0.1,0.9)), w, gp = gpar(fill='grey')),
linesGrob(x = rescale(st$x, c(0.1,0.9)) ,
y = rescale(st$y, c(0.1,0.9)), gp=gpar(lty=2,col='red'))
))
}
gridExtra::grid.arrange(grobs=gl,vp=viewport(width=0.8,height=0.8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment