[R] comma-separated thousands in numbers on plot axes?

Jim Lemon jim at bitwrit.com.au
Mon Jun 29 11:15:52 CEST 2009


Alexy Khrabrov wrote:
> How can I make R separate thousands, millions, etc., on the plot axes,
> with commas?
>
>   
Hi Alexy,
You might try formatting the labels with the "comma" function in the 
ggplot2 package:

axis(1,at=seq(1000000,5000000,by=1000000),
 labels=comma(seq(1000000,5000000,by=1000000)))

Jim




More information about the R-help mailing list