-1

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 the axis, or in the case of 10000, for example, on the 10,000 axis .

  • 1
    ggplot or base plot? Or something else? Can you make a small example? even just `plot(1000, 10000)` if that is comparable to your actual use. – Gregor Thomas Dec 05 '17 at 22:03
  • I'm using the plot function – Roger Figueroa Quintero Dec 05 '17 at 22:05
  • `plot()` is a generic function so it can do very different things based on what you pass to it. It's always better to provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) when asking for help. – MrFlick Dec 05 '17 at 22:06

1 Answers1

2

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 = "."))
MrFlick
  • 195,160
  • 17
  • 277
  • 295