# Plot for big x numbers

I want to make a plot of data with big values by x. My code is this

myList = {{10^15, 1}, {10^15 + 1, 1.2}, {10^15 + 2, 1.5}, {10^15 + 3, 1.1}}
ListPlot[myList, PlotRange -> {{10^15, 10^15 + 3}, {0, 2}}]


but when I get a plot, it looks like x always the same

and look like mathematica ignores my PlotRange and make it from 0 to 2*10^15.

How can I force mathematica to make x axis from 10^15 to 10^15 + 3?

UPDATE1

I also have similar problem if I want to plot function like this

Plot[Sin[x],{x,10^15, 10^15 + 3}]


of course if I convert it to the Table and use solution from Simon Rochester's answer, it will work.

ListPlot[Transpose[Transpose[Table[{x,Sin[x]}, {x,10^15, 10^15 + 3, 0.1}]] - {10^15, 0}], PlotRange -> {{0, 3}, {-1, 1}}]


but is there any way to do it directly with Plot[]?

I put this example to mathematica cloud. I hope it will work for everyone.

UPDATE2

I can do it with Plot of function like this

Plot[Sin[10^15+x],{x,0, 3}]


But somehow graph looks strange :)

• Interestingly, for me the boundary for this breaking appears to be at 4.398046511103750*^13 , which doesn't have much numerical relevance as far as I know. Commented Dec 8, 2016 at 11:06
• Yes, it is strange. Might be it is a mathematica bug. Commented Dec 8, 2016 at 12:13
• At first glance this looks like a bug in Graphics, but perhaps it is merely a design limitation or I misunderstand. e.g. Graphics[Point[myList], PlotRange -> {{10^15, 10^15 + 3}, {0, 2}}, AspectRatio -> 1/GoldenRatio, Axes -> True] also does not work "correctly." Commented Dec 8, 2016 at 15:41
• that last jagged plot is a precision problem, try Plot[Sin[10^15 + x], {x, 0, 3}, WorkingPrecision -> 20] Commented Dec 8, 2016 at 21:29
• @george2079 Yes, thanks. Your example works fine. Commented Dec 9, 2016 at 10:42

Might I suggest not making a plot like that? Whatever information that you are trying to get across will likely be clearer if you plot with x-values relative to $10^{15}$ and note that in the axes label or the caption:

ListPlot[Transpose[Transpose[myList] - {10^15, 0}], PlotRange -> {{0, 3}, {0, 2}}]


If you really want big numbers on the axis, you could put them there by hand:

ListPlot[Transpose[Transpose[myList] - {10^15, 0}], PlotRange -> {{0, 3}, {0, 2}},
Ticks -> {Join[Table[{i, i + 10^15}, {i, 0, 3, 3}], Table[{i, "", {.01, 0}}, {i, 0, 3, .5}]], Automatic}
]


• Wow. It is very good answer. But what can I do if I need to plot some function like this: Plot[Sin[x],{x,10^15, 10^15 + 3}] ? Commented Dec 8, 2016 at 10:11

Just to summarize for the people who will search it. There are 3 solutions:

1. Like suggested by Simon Rochester

myList = {{10^15, 1}, {10^15 + 1, 1.2}, {10^15 + 2, 1.5}, {10^15 + 3, 1.1}} ListPlot[Transpose[Transpose[myList] - {10^15, 0}], PlotRange -> {{0, 3}, {0, 2}}]

1. Solution for problem Plot[Sin[x],{x,10^15, 10^15+3}] based on Simon Rochester's answer

ListPlot[Transpose[Transpose[Table[{x,Sin[x]}, {x,10^15, 10^15 + 3, 0.1}]] - {10^15, 0}], PlotRange -> {{0, 3}, {-1, 1}}]

1. Solution with plot

Plot[Sin[10^15+x], {x,0,3}]

and to avoid steps

Plot[Sin[10^15+x],{x,0,3}, WorkingPrecision->20]


and with proper ticks (from Simon Rochester's example)

Plot[Sin[10^15+x],{x,0, 3}, Ticks -> {Join[Table[{i, i + 10^15,{0.02,0}}, {i, 0, 3, 1}], Table[{i, "", {0.01, 0}}, {i, 0, 3, .1}]], Automatic},WorkingPrecision->20]


All problem and solution are available here. It is mathematica cloud, I am not sure how long it will be available.