gpt4 book ai didi

R绘图为什么不从(0,0)开始?

转载 作者:行者123 更新时间:2023-12-04 14:51:19 24 4
gpt4 key购买 nike

我是 R 编程和图形的新手。我正在尝试绘制图形,但 (0,0) 点不在正确的位置。有人可以告诉我如何解决吗?谢谢。
enter image description here

这是我的代码:

layout(matrix(c(0,0,0,0,0,
0,1,3,2,0,
0,0,0,0,0), nc = 5, byrow = TRUE),
widths = c(lcm(2), 1, lcm(2), 1, lcm(2)),
heights = c(lcm(2), 1, lcm(2)))
layout.show(3)
box("outer", lty = "dotted")
plot.new()
plot.window(xlim=c(-200,0),ylim=c(0,21))
box()
axis(1)
axis(4)
rect(-113,0,0,1,col='cyan')

最佳答案

你可以去看看'xaxs'?par

关于R绘图为什么不从(0,0)开始?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6159484/

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