How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Vectorised Patterns in R Graphics

calendar_today June 8, 2022 person domain r

Support for pattern fills was added to the R graphics engine in R version 4.1.0, with an R interface via the ‘grid’ package. library(grid) For example, the following code defines a linear gradient that varies horizontally from red to white and a tiling pattern that is based on a repeating red circle. gradcol <- c(palette()[2], “white”) grad <- linearGradient(gradcol, y1=.5, y2=.5) patcol <- 2 pat <- pattern(circleGrob(r=unit(2, “mm”), gp=gpar(col=patcol, fill=patcol)), width=unit(5, “mm”), height=unit(5, “mm”), extend=”repeat”) The next code calls grid.

open_in_new Read original post