开发者

log scale x-axis labels

开发者 https://www.devze.com 2023-01-11 04:20 出处:网络
The labels on the x-axis are defaulting to scientific notation no matter how small cex.axis is.How can I override scientific notation to get the labels to print out as sp开发者_运维知识库ecified?Here

The labels on the x-axis are defaulting to scientific notation no matter how small cex.axis is. How can I override scientific notation to get the labels to print out as sp开发者_运维知识库ecified? Here is the code (UNIT here is 0.0105):

plot( xm,yv ,log="xy",ylim=c(0.1,20)/UNIT,
  xlim=c(0.004,20)*UNIT,xlab="Dose",xaxt="n",ylab="Amount",type="n")
axis(1,at=c(0.0001,0.005,0.001,0.05,0.01,0.5,1),cex.axis=0.9)


try using the labels= argument in axis() and providing an as.character() version of your at= argument.


Another option is to set options(scipen=5) before your plot. scipen=0 is the default on my system, so you could try integers >0 to see which one gives you the results you are looking for.

0

精彩评论

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