有没有一种简单的方法将网格放置在情节背景R中

时间:2017-03-29 07:22:13

标签: r plot grid

我必须在我的情节中绘制网格。我找到了一个用于此目的的解决方案

barplot(1:50)
grid()
box()
par(new = TRUE)
barplot(1:50)

以下是情节 enter image description here 我很好。但为什么我应该两次打电话给barplot。是否有一些简单的方法将网格移动到背景?

我面临以下问题是我的情节(boxplot)

png("test2.png")
bm = boxplot(exuper, fuper, super, tuper, dat$uper, outline = F, names=names, panel.first = grid())
box()    
dev.off()

和错误是

Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet
> box()
Error in box() : plot.new has not been called yet

0 个答案:

没有答案