如何创建方形尺寸的图?

时间:2017-06-21 16:45:50

标签: r plot

我用下面的剧本绘制了一个情节,但它给了我一个矩形图,我想绘制一个方形图。我使用'width = 4,height = 4'但它没有用。

data:
             A1     A2     A3 
  s1        0.5     0.3    0.6
  s2        0.6     0.2    0.1

matplot(cbind(data$A1,data$A2,data$A3), type = c('p'),pch=c(19,19),col = 1:3,las=1,xaxt='n')

1 个答案:

答案 0 :(得分:1)

来自?par

pty
     A character specifying the type of plot region to be used; "s"
     generates a square plotting region and "m" generates the maximal
     plotting region.

在您的情况下,请尝试

windows(width = 8, height = 8)
par(pty = "s")
matplot(cbind(data$A1,data$A2,data$A3), type = c('p'),pch=c(19,19),col = 1:3,las=1,xaxt='n')