Force R to stop plotting abbreviated axis labels - e.g. 1e+00 in ggplot2

前端 未结 7 1384
遥遥无期
遥遥无期 2020-11-28 04:09

In ggplot2 how can I stop axis labels being abbreviated - e.g. 1e+00, 1e+01 along the x axis once plotted? Ideally, I want to force R to display the actual valu

7条回答
  •  孤独总比滥情好
    2020-11-28 04:49

    Isn't the simplest general solution to set the penalty that R uses for scientific notation higher?

    i.e set scipen() to a number that you are comfortable with.

    e.g. If your axis maximum on charts is likely to be 100 000, setting scipen(200000) will ensure that R (and ggplot) will use standard notation for all numbers below 200000 and there will be no requirement to add any lines to the ggplot function.

提交回复
热议问题