我想在ggplot图中的连续轴上格式化数字 . 我希望有一个大数字的法语格式,每三位数一个空格(即"20 000"而不是"20000") . 我知道可以使用 format() 函数(例如 format(20000, scientific=FALSE, big.mark = " ") )来完成它,但我不知道如何将此函数与ggplot结合使用 . 我可以想象_1839179中有一个选项,但我自己无法找到解决方案 . 这是我的gist file .
format()
format(20000, scientific=FALSE, big.mark = " ")
french = function(x) format(x, big.mark = " ") p + scale_y_continuous(labels=french)
1 回答