Force R to write scientific notations as n.nn x 10^-n with superscript

喜夏-厌秋 提交于 2019-12-01 20:54:07

You may check eaxis in package sfsmisc

# some data
x <- seq(1, 100000, len = 10)
y <- seq(1e-5, 1e-4, len = 10)

# default axes
plot(x, y)

# eaxis
plot(x, y, axes = FALSE)
eaxis(side = 1)
eaxis(side = 2)

You may also create a label expression using pretty10exp() from the same package. For example to apply the format to a plot title:

plot(x, y, axes = FALSE)
title(pretty10exp(y[1]))

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!