R的基本图形系统中的几个函数,包括rect()和polygon(),通过它们angle=和density=参数支持交叉影线:
x = c(0, 0.5, 1, 0.5)
y = c(0.5, 1, 0.5, 0)
par(mar=c(0,0,0,0))
plot.new()
polygon(x, y, angle=45, density=10)
Run Code Online (Sandbox Code Playgroud)

如何将类似的交叉影线应用于由网格图形系统的grid.polygon()函数绘制的多边形:
library(grid)
grid.newpage()
grid.polygon(x,y)
Run Code Online (Sandbox Code Playgroud)

我看了说明文档中?grid.polygon和?gpar,并通过保罗具有Murrel的书在R图形有脱脂和迄今拿出空.我错过了一些明显的东西吗 如果没有,是否有一些简单的黑客可以使这成为可能?
我在"经济学人"的网站上看到了这些图片,并想知道是否有可能制作出一个geom_bar()嵌入这种说明性图标的图片?(下面的虚拟数据)

虚拟数据,
require(ggplot2)
# Generate data
df3 <- data.frame(units = c(1.3, 1.8, 2.7, 4.2, 4.7, 6.7, 20),
what = c('Wikipedia', 'London Olympic Park', 'Aircraft carrier',
'The Great Pyramid', 'Stonehenge', 'Burj Khalifas',
'Empire State Building'))
# make gs an ordered factor
df3$what <- factor(df3$what, levels = df3$what, ordered = TRUE)
#plots
ggplot(df3, aes(what, units)) + geom_bar(fill="white", colour="darkgreen",
alpha=0.5, stat="identity") + coord_flip() + scale_x_discrete() +
scale_y_continuous(breaks=seq(0, 20, 2)) + theme_bw() +
theme(axis.title.x = element_blank(), axis.title.y …Run Code Online (Sandbox Code Playgroud) test <- data.frame(a=c(1,2,3,4), b=c(4,4,4,4))
ggplot(test, aes(x=a, y=b, fill=factor(a)))+geom_bar(stat='identity')
Run Code Online (Sandbox Code Playgroud)

但我也想在这个情节中添加texitiles,例如:

非常感谢你