# About number truncation of ticks display in ListPlot

In my problem, I need to plot a figure in a relatively small region of the $x$ axis, e.g.,

ListPlot[{RandomReal[#] + 10^4,
RandomReal[#]} & /@ (Range[100] 10^-10), Frame -> True, Axes -> False]

and the figure is displayed properly, but all the tick marks have the same label:

Is there any clever way to get rid of this problem?

• 欢迎来到Mathematica.SE! :-) Don't worry about image uploading, you'll soon have enough reputation to do it. Until then we'll help you. Please make sure to include the question in the body of the post as well (not only in the title). A little redundancy doens't help May 7, 2012 at 13:44
• Oh great! I think U know well about Chinese language, SZabolcs. May 11, 2012 at 1:26
• Related: (3436) Oct 29, 2014 at 9:55

You can define your own function for FrameTicks :

ticks[min_, max_] := {#, NumberForm[#, 20]} & /@
N[FindDivisions[{min, max}, 5]]

ListPlot[{RandomReal[#] + 10^4,
RandomReal[#]} & /@ (Range[100] 10^-10), Frame -> True,
FrameTicks -> {{Automatic, None}, {ticks, None}}]

Just choose your own preferred presentation format of the given values...

ticks[min_, max_] := {#, Grid[{{min}, {"+"}, {# - min}}]} & /@
N[FindDivisions[{min, max}, 5]]

ListPlot[{RandomReal[#] + 10^4,
RandomReal[#]} & /@ (Range[100] 10^-10), Frame -> True,
FrameTicks -> {{Automatic, None}, {ticks, None}},FrameStyle->Medium]

• Excellent work!! May 7, 2012 at 13:04
ListPlot[{RandomReal[#] + 10^4, RandomReal[#]} & /@ (Range[100] 10^-10), Frame -> True,
Axes -> False, FrameLabel -> {"x - 10^4", "y"}] /.
List[x_, y_] /; x > 10000 -> List[x - 10000, y]

• i'm sure it'a a way to solve it. May 7, 2012 at 13:05