我想知道是否有可能在R中绘制带有轮廓的文本,使得文本独立于背景可读(就像meme上的文本)。以下方法(显然)失败了:
结果并不惊人:
# prepare a colorful background
randcolors <- sprintf( "#%02X%02X%02X99", sample(1:255, 1000, replace=T), sample(1:255, 1000,replace=T), sample(1:255, 1000, replace=T))
plot( NULL, xlim=c(0,1), ylim=c(0,1), xaxt="n", bty="n", yaxt="n")
points( runif(1000, 0, 1 ), runif( 1000, 0, 1 ), cex=runif(1000, 0.5, 5), col= randcolors, pch= 19)
text( 0.5, 0.5, "test text", cex= 5 )
text( 0.5, 0.5, "test text", cex= 4.5, col="white" )
结果并不惊人:
ggplot
的可能性链接。 - Henrik