gpt4 book ai didi

r - 无效的行类型 : must be length 2, 4、6 或 8

转载 作者:行者123 更新时间:2023-12-03 22:50:17 25 4
gpt4 key购买 nike

我正在使用线段绘制线条,但我需要对线条类型进行更多控制。所以我正在使用 lty="1"但我收到错误消息。我正在使用下面的代码。

segments(593, 20.65+.06, 593+3, 20.65+.06, col= "black", lty="1")

但我收到以下错误消息。
  Error in segments(593, 20.65 + 0.06, 593 + 3, 20.65 + 0.06, col = "black",  : 
invalid line type: must be length 2, 4, 6 or 8

我只需要控制 lty() 中提到的线型。我该如何解决这个问题?

最佳答案

您可以通过阅读 ?par 来修复它:

Line types can either be specified by giving an index into a small built-in table of line types (1 = solid, 2 = dashed, etc, see lty above) or directly as the lengths of on/off stretches of line. This is done with a string of an even number (up to eight) of characters, namely non-zero (hexadecimal) digits which give the lengths in consecutive positions in the string. For example, the string "33" specifies three units on followed by three off and "3313" specifies three units on followed by three off followed by one on and finally three off. The ‘units’ here are (on most devices) proportional to lwd, and with lwd = 1 are in pixels or points or 1/96 inch.



因此,将一个字符传递给 lty不代表你的想法。你可能只是想说 lty = 1 .

关于r - 无效的行类型 : must be length 2, 4、6 或 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18049365/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com