java中的画图公式,在R中使用“col”参数Plot函数

虽然在R中生成绘图的最常用函数是 plot ,但您可以在 ?par 文档下找到最有用的信息 . 在其中,有一个 Color Specification 部分描述了如何为绘图设置颜色 . 这里有一段摘录:

Colors can be specified in several different ways. The simplest

way is with a character string giving the color name (e.g.,

‘"red"’). A list of the possible colors can be obtained with the

function ‘colors’. Alternatively, colors can be specified

directly in terms of their RGB components with a string of the

form ‘"#RRGGBB"’ where each of the pairs ‘RR’, ‘GG’, ‘BB’ consist

of two hexadecimal digits giving a value in the range ‘00’ to

‘FF’. Colors can also be specified by giving an index into a

small table of colors, the ‘palette’: indices wrap round so with

the default palette of size 8, ‘10’ is the same as ‘2’. This

provides compatibility with S. Index ‘0’ corresponds to the

background color. Note that the palette (apart from ‘0’ which is

per-device) is a per-session setting.

请注意,在您的情况下,您没有将 character 传递给 col 参数,而是 factor ,它基本上是一个整数值 . 此外,您可以指定与要绘制的点数一样多的颜色,这样您就可以声明每个点的颜色 .

希望这可以帮助 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值