how to establish the point “.” as a thousand separator in the numbers of the Y axis in R?

后端 未结 1 618
一个人的身影
一个人的身影 2021-01-28 13:27

I\'m using the plot function and I would like my numbers to have a thousand separator on the Y axis. For example, in the case of 1000 I would like the 1,000 number to be seen on

相关标签:
1条回答
  • 2021-01-28 14:11

    If you are using base plot() you can turn off the default axes, then just use axis() to draw whatever you like on the axes

    x<-seq(0, 100000, length.out=11)
    y<-seq(0, 10000, length.out=11)
    plot(x,y, xaxt="n", yaxt="n")
    
    axis(1, axTicks(1), format(axTicks(1), big.mark = "."))
    axis(2, axTicks(2), format(axTicks(2), big.mark = "."))
    
    0 讨论(0)
提交回复
热议问题