这个:
ggplot(Data, aes(x = Bla), bins = 30, labels = TRUE, format(x, scientific = FALSE)) +
geom_histogram()
Run Code Online (Sandbox Code Playgroud)
不起作用。我想取消科学记数法(例如 1.0e+07)。有任何想法吗?谢谢!
options(scipen = 999)如果您不想为所有图表设置此选项,则可能需要避免使用几个选项。
ggplot(Data, aes(x = Bla), bins = 30) +
geom_histogram() +
scale_x_continuous(labels = ~ format(.x, scientific = FALSE))
Run Code Online (Sandbox Code Playgroud)
或者
ggplot(Data, aes(x = Bla), bins = 30) +
geom_histogram() +
scale_x_continuous(labels = scales::comma)
Run Code Online (Sandbox Code Playgroud)
相反scales::comma,该scales套餐还提供
如果您有财务数据或日期,这会很方便。
| 归档时间: |
|
| 查看次数: |
2296 次 |
| 最近记录: |