[英]How to change the scale(interval) of Y-axis in a scatter plot in R?
[英]How to make different scales (interval) on x axis and y axis for scatter plot in R
我的數據中有兩個連續變量(A和B)。 我想用R中的回歸線制作散點圖。我認為這很容易。 但是,如何為X軸上的A和y軸上的B設置不同的比例(間隔)? 例如,X軸上的A:2、4、6、8、10,間隔為2。如何將其更改為:1、2、3、4、5、6、7、8、9、10,其中間隔為1。y軸類似。
非常感謝!
Robert Kabacoff的網站上有很好的說明。 簡而言之,您可以使用如下代碼:
z = c(1:10)
plot (A,B) #add whatever specifications you need
axis (1, at=z, labels=z) #1 indicates the lower horizontal axis; 1=bottom, 2=left, 3=top, 4=right
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.