开发者

R plotting why not starting from (0,0)?

开发者 https://www.devze.com 2023-03-09 02:28 出处:网络
I\'m new to R programming and graphics. I\'m trying to draw a graph but the (0,0) point is not at the right place. Can someone please tell me how to fix it? Thanks.

I'm new to R programming and graphics. I'm trying to draw a graph but the (0,0) point is not at the right place. Can someone please tell me how to fix it? Thanks.

R plotting why not starting from (0,0)?

Here's my code:

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')


you can go to see 'xaxs' in ?par

0

精彩评论

暂无评论...
验证码 换一张
取 消