How to define fixed aspect-ratio for scatter-plot

后端 未结 2 1788
醉梦人生
醉梦人生 2020-12-01 10:03

I am plotting correlation coefficients (values = 0.0:1.0) for two isotopes measured in each individual from two populations. I would like to have a fixed aspect-ratio for my

相关标签:
2条回答
  • 2020-12-01 10:39
    par(pty="s")
    plot(...)
    

    sets the plot type to be square, which will do the job (I think) in your case because your x and y ranges are the same. Fairly well hidden option documented in ?par.

    0 讨论(0)
  • 2020-12-01 10:57

    Using asp=1 as a parameter to plot will get interpreted by the low-level plot.window call and should give you a unitary aspect ratio. There is the potential that a call using ylim and xlim could conflict with an aspect ratio scpecification and the asp should "prevail". That's a very impressive first R graph, by the away. And an excellent question construction. High marks.

    The one jarring note was your use of the construction xlim=c(0:1.0). Since xlim expects a two element vector, I would have expected xlim=c(0,1). Fewer keystrokes and less subject to error in the future if you changed to a different set of limits, since the ":" operator would give you unexpected results if you tried that with "0:2.5".

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