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.

There seem to be a problem with ListPlot auto ranging in Mathematica 9.

Here's my code:

n = 10;
dn = 10;
data = Table[If[Divisible[i - n, dn], i, 1], {i, 1,  100}];
ListPlot[data, PlotRange -> Automatic]

In version 8 it works as expected (y ranges from 0 to 100), but in version 9 it only shows y going from 0 to 2. Is there something wrong with my code? A bug in Mathematica?

share|improve this question
    
I have y range from 0 to 100 in Wolfram Mathematica 9.0.1. –  m0nhawk Sep 11 '13 at 11:12
1  
In v. 9.0.1, as the documentation for PlotRange indicates, "outlying points are dropped." –  David Carraher Sep 11 '13 at 11:27
1  
@m0nhawk Strange. I also use 9.0.1. Platform Windows 64. Which platform are you on? –  Max Sep 11 '13 at 11:36
1  
y: {0, 2} under Mathematica 9.0.1.0 Win7 x64. y: {0, 100} under Mathematica 8.0.0.0 Linux x86. Interestingly, there is no indication in the doc under PlotRange (in v9) that it has ben modified since v8. –  István Zachar Sep 11 '13 at 11:42
2  
Maybe I'm missing the point but "Automatic" and "outlying points" are not very precise statements so I would not expect any specific behaviour. So do not worry :) @IstvánZachar Ah, another one to the list of hidden updates. :/ –  Kuba Sep 11 '13 at 11:55
show 4 more comments

1 Answer

up vote 1 down vote accepted

If you want to see all the points, including outliers, use PlotRange->All instead of PlotRange->Automatic.

n = 10; dn = 10; data = Table[If[Divisible[i - n, dn], i, 1], {i, 1,  100}];
{ListPlot[data, PlotRange -> Automatic], ListPlot[data, PlotRange -> All]}

enter image description here

share|improve this answer
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.