[R] Formatting of numbers on y axis

Joris Meys jorismeys at gmail.com
Thu Dec 3 17:52:14 CET 2009


The problem is easily solved by plotting salaries$salary/1000000

Cheers
Joris

On Thu, Dec 3, 2009 at 5:16 PM, Wells Oliver <wells at submute.net> wrote:
> Hello all. I have the following:
>
> plot(salaries$yearID, salaries$salary, type='n', xaxt='n', xlab='',
> yaxt='n', ylab='')
> axis(1, at=unique(salaries$yearID), labels=unique(salaries$yearID), lwd=.25,
> tck=-0.05)
> axis(2, axTicks(2), format(axTicks(2), scientific = F))
>
> Which nicely creates the Y axis with the raw numbers, which are in the range
> of .5 - 7 million.
>
> However, it displays them as "1000000", and so on- I'd like it to show just
> whole numbers 1, 2, 3, through 7, so I can label the Y axis "in millions".
> Any tips?
>
> Thanks!
>
> --
> Wells Oliver
> wells at submute.net
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list