Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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:

Mathematica graphics

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

share|improve this question
2  
欢迎来到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 –  Szabolcs May 7 '12 at 13:44
    
Oh great! I think U know well about Chinese language, SZabolcs. –  yulinlinyu May 11 '12 at 1:26
add comment

2 Answers 2

up vote 13 down vote accepted

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}}]

Mathematica graphics

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]

Mathematica graphics

share|improve this answer
    
Excellent work!! –  yulinlinyu May 7 '12 at 13:04
add comment
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]

enter image description here

share|improve this answer
1  
i'm sure it'a a way to solve it. –  yulinlinyu May 7 '12 at 13:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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