我想根据我拥有的 tictactoe 板创建一个连接四板。然而,事情听起来不匹配,我没有完全正确的结果。我想要6行7列!
par(pty="s") # square plot type
x = rep(1:6, each = 6)
y = rep(1:7, times = 7)
symbols(x, y, squares=rep(1, times=42),
inches=FALSE, # match squares to axes
xlim=c(0,7),
ylim=c(8,0)) # flip y axis to match matrix format
board = matrix(rep("E", times=42), nrow=6, ncol=7)
我收到这个错误:
Error in xy.coords(x, y, xlab = deparse(substitute(x)), ylab = deparse(substitute(y))) :
'x' and 'y' lengths differ
下面是 tictactoe 的代码和之后显示的板子:
par(pty="s") # square plot type
x = rep(1:3, each = 3)
y = rep(1:3, times = 3)
symbols(x, y, squares=rep(1, times=9),
inches=FALSE, # match squares to axes
xlim=c(0,4),
ylim=c(4,0)) # flip y axis to match matrix format
board = matrix(rep("E", times=9), nrow=3, ncol=3)
将第 2 行和第 3 行更改为以下内容后:
x = rep(1:6, each = 7); y = rep(1:7, times = 6)
我得到了以下情节。你知道为什么水平线是这样的吗?并且不锐利并且它们模糊?