6

How can I most cleanly force Mathematica not to print ticks in scientific notation? Do I have to manually provide the tick labels?

Rendering the numbers in exact form would be sufficient. If there is a way to express formatting with a function that would be optimal.

Plot[x, {x, 0, 10^10}]

enter image description here

mfvonh
  • 8,460
  • 27
  • 42

2 Answers2

4

Use the Table function or something similar within the Ticks option to make this easy on you. Consider this, which changes the y-axis ticks, while leaving the x-axis ticks alone:

Plot[x, {x, 0, 10^10}, 
 Ticks -> {Automatic, Table[{2 i 10^9, 2 i 10^9}, {i, 1, 5}]}]

enter image description here

ktm
  • 4,242
  • 20
  • 28
4
longticks = 
  Show[#, AbsoluteOptions[#, 
      Ticks] /. {n_?NumberQ, n_, a_List, b_List} :> {n, AccountingForm[n], a, b}] &;

Plot[x, {x, 0, 10^10}] // longticks

enter image description here

Recommended reading:

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
  • 1
    Does this still work with MM 13? I'm copy-pasting this code and get numbers in the format of 8*^9 etc. – tukan Jun 08 '22 at 16:12