R中的灰度堆叠面积图

3

我正在使用plotrix包中的stackpoly()命令在R中绘制一个堆叠面积图。默认颜色非常刺眼,有没有办法使用符号或灰度代替?


1
请提供一个可运行的示例。 - Vincent
1个回答

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.
稍微修改一下来自?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)))

这里输入图片描述


谢谢。如果我可以有点儿讽刺的话:你或许可以通过在“stackpoly”页面搜索“color”来自己找到这个答案... - Ben Bolker
1
我本应该注意到它,但是没有。对于粗心的研究表示歉意。我仍然感激您的帮助。 - user702432

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接