R中的灰度堆积区域图

use*_*432 3 plot r

我正在使用stackpoly()plotrix包中的命令在R中绘制堆积区域图.至少可以说,默认颜色很明显.有没有办法使用符号或灰度代替?

Ben*_*ker 10

来自?stackpoly:

 col: Color to fill the polygons. If NULL, ‘rainbow’ will be called
      to generate the colors. If NA, the polygons will not be
      filled.
Run Code Online (Sandbox Code Playgroud)

稍微修改以下示例?stackpoly:

stackpoly(matrix(cumsum(testx),nrow=10),main="Test Stackpoly I",
   xaxlab=c("One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"),
  border="black",staxx=TRUE,
col=gray(seq(0.1,0.9,length=10)))
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述