首页 > 解决方案 > 我在 ggplot2 中的图形在 y 轴上包含一个“e”字符

问题描述

y轴上的“e”是什么意思?

ggplot(econdata, aes(x = Country, y = GDP_nom)) +
  geom_bar(stat='identity', fill = "forest green") +
  ylab("GDP (nominal)")

R语言中的ggplot2图形示例

标签: rggplot2

解决方案


e代表,10^表示 1.5e7 = 1.5*10^7 = 15'000'000。这个“e 表示法”相当标准,是科学记数法的编程版本(有 10 次幂的东西,请参阅https://en.wikipedia.org/wiki/Scientific_notation)。

并不是说您可以使用此表示法定义变量。例如 100 万次写入x=1e6


推荐阅读