5

I have a plot

enter image description here

How can I format the x and y axis so they are not in scienftic notation?

Thank you.

user3022875
  • 8,598
  • 26
  • 103
  • 167
  • This question has already been answered: http://stackoverflow.com/questions/5352099/how-to-disable-scientific-notation-in-r – C_Z_ Mar 09 '15 at 19:35

1 Answers1

8

I believe you can do this by adjusting the scientific notation setting for R in general. This should pretty much disable it: options(scipen=999)

Danny
  • 3,077
  • 2
  • 23
  • 26
  • 1
    That worked! Do you know how to format the x axis with commas? so 50000 is 50,000 – user3022875 Mar 09 '15 at 19:48
  • 1
    You can do that to individual numbers like this: `format(1e6, big.mark=",", scientific=FALSE)` But to get the axis like that you will have to manually replace the entire axis, which is a bit of a pain. – Danny Mar 09 '15 at 19:53
  • Can you give an example of how to replace the axis to get the format with the commas? – user3022875 Mar 09 '15 at 20:35
  • As I said, it is a bit painful and involved. I would need to know more about your specific case to give an exact solution. In general you disable the axis with the `xaxt='n'` parameter in the plot function, then manually add an axis in with the "axis" function. Read `help(axis)` for full explanation or just post another question with more details about your situation. – Danny Mar 09 '15 at 20:56