日志y轴的标签:1000而不是1e + 03?

6 algorithm statistics graphics r

我有一个关于在图形中构建log y轴的问题.

如何管理我的日志y轴的单位/数字未显示

1e+03, 1e+04, 1e+05 etc....
Run Code Online (Sandbox Code Playgroud)

但只有普通的阿拉伯数字(1000,10000,100000)?

Sha*_*ane 6

您需要删除轴(通过设置yaxt = "n"),然后正确地重新格式化它:

plot((1:100)^3, log = "y", yaxt = "n")
axis(2, format(c(1,10,100)^3, scientific=FALSE))
Run Code Online (Sandbox Code Playgroud)

之前在R-help上询问过这个问题.

  • 我建议在第二行使用axis(2,format(axTicks(2,log = TRUE),scientific = FALSE)).然后它不那么"人类依赖". (3认同)