2
我想格式化我的x軸爲log2(n+1)
格式,所以x軸標籤對應於1,2,4,16等等。如何以log2(n + 1)格式重新縮放x軸上的標籤?
輸入:
x <- c(1, 2, 3, 11, 15)
y <- c(1.1, 1.2, .4, 2.1, 1.5)
plot(log2(x + 1), y, axes=FALSE)
axis(1, at=(labels=as.character(formatC(x))), cex.axis=0.9)
但情節我拿到仍然有原來的X軸的值。
我怎樣才能讓我的x軸功率2(1,2,4,16,等等)?
我需要C(1,2,4,8,16,32)等距隔開。有可能實現嗎? – Manish 2012-08-15 07:26:49
對於'log2(x + 1)',序列1,3,7,15,31將是等距的。你的是'log2(x)'。 – Roland 2012-08-15 07:34:13
X <-c(15.918,8.822,0.619,0.060,0.479,2.913,2.456,0.927,1.121 0.255,0.000,0.549,0.095)Y <-c(19,圖7,0,0,1,3,2, 1,0,0,1,1,0) 如果我使用烏爾系列實驗室<-round(2^SEQ(分鐘(LOG2(X + 1)),最大值(LOG2(X + 1)),length.out = 6)-1) 我得到0 1 2 4 9 16,但我需要添加1,3,7,15,31(如u建議的)等距隔開。我該怎麼做? – Manish 2012-08-15 07:50:10