How can I make the zero tick appear in the lefthand corner in R plots?

后端 未结 1 1143
Happy的楠姐
Happy的楠姐 2021-01-04 20:15

When you generate plots in R with the \'plot\' command, and set the left side x-axis limit to zero, with, e.g.

plot(x=c(1:10), y=c(1:10), xlim=c(0,10), ylim=         


        
相关标签:
1条回答
  • 2021-01-04 20:28

    In calls to plot(), both xlim and ylim are by default padded (extended) by 4%. To suppress this behavior, set xaxs = "i" and/or yaxs = "i".

    For more details, see the help page for par.

    plot(x=c(1:10), y=c(1:10), xlim=c(0,10), ylim=c(0,10), xaxs="i", yaxs="i")
    

    enter image description here

    0 讨论(0)
提交回复
热议问题