4
$\begingroup$

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

$\endgroup$
  • $\begingroup$ What would you like the tick labels to look like, then? $\endgroup$ – J. M. is away Aug 26 '17 at 2:03
  • $\begingroup$ Good question -- let me add more detail. Thanks. $\endgroup$ – mfvonh Aug 26 '17 at 2:04
3
$\begingroup$
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:

$\endgroup$
3
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.