# Inaccurate data range in ListPlot

I want to have axes x on my ListPlot as the range (1,1386), but when I run my code

l =  Table[
Sum[Binomial[k, j]*j^a*(-1)^(k - j), {j, 0, k}], {k, 1, 1386}];
For[i = 0, i < 3, i++, AppendTo[l, 0]]
m = Table[Sum[Binomial[k, j]*j^b*(-1)^(k - j), {j, 0, k}], {k, 1, 1389}];
p = ((2000^1389)/(2000^1386))*(l/m);
t = Table[
N[Reduce[ 1/(1 + f) <= p[[i]] <= 1 + f && f >= 0 , f], 100], {i, 1,
Length[p]}]
t = Cases[t, Except[False]]
tt = t[[All, 2]]

ListPlot[tt,
Filling -> Top,
GridLines -> Automatic,
PlotStyle -> {Red, PointSize[Large]},
PlotMarkers -> {Automatic, Medium}, DataRange -> {1, 1386},
AxesLabel -> {k, alpha}]


the plot has range to 1400 (I mean the last number marked on the axes is 1400) How can I fix that to have the last marked value as 1386?

-
Could you please post tt or the function that generates it? – István Zachar Jan 6 '14 at 17:03
@IstvánZachar Done. To post tt I needed to post another lists of values, so it might be a little messy. – Ziva Jan 6 '14 at 17:08
Your tt is taking a long time to generate... you should make a minimal working example instead (since your issue is not related to the data, but to the plotting). – R. M. Jan 6 '14 at 17:13

You have to specify Ticks for ListPlot (see this), like

...
Ticks -> {Join[Table[n, {n, 1, 1400, 100}], {1386}], Automatic}
....


If I understood your code, you attemped to do something like

t = Table[n, {n, 1, 200}];
ListPlot[t, PlotMarkers -> {Automatic, Medium}, DataRange -> {1, 1386},
Ticks -> {Join[Table[n, {n, 1, 1400, 100}], {1386}], Automatic}]


Note the interplay between DataRange and Ticks.

Hope it helps.

-
Your post is great and very helpful. Thanks! – Ziva Jan 6 '14 at 18:55