【发布时间】:2011-04-06 08:01:32
【问题描述】:
在原版绘图中,可以在panel.first 参数中使用polygon 调用plot 来突出显示背景区域。是否可以在ggplot2 中做同样的事情?可以在保留网格线的同时做到吗?
例如:
# plot hp and wt for mtcars data, highlighting region where hp/wt ratio < 35
with(mtcars,plot(hp,wt,
panel.first=polygon(c(0,0,max(wt)*35),c(0,max(wt),max(wt)),
col="#d8161688",border=NA)))
【问题讨论】: