I have a table: p1 = Table[(Binomial[2000, k]*StirlingS2[1386, k]*k!)/(2000^1386), {k, 1, 1386, 1}];

I used ListPlot[p1] to draw a plot of this values. This is the plot, where on Y I have values of p1 and on X I have values of k. But when I draw my plot, I see only points which are starting from $k \approx 560$. Why I can't see points for all values of k? Is this because of that values for small k are too small? How can I fix that?

  • $\begingroup$ Just add PlotRange->Full. $\endgroup$ – C. E. Jan 22 '14 at 19:50
  • $\begingroup$ @Pickett It doesn't helped. $\endgroup$ – Ziva Jan 22 '14 at 19:55
  • 2
    $\begingroup$ @picket and closers: PlotRange isn't the issue here. The points Zia is missing (before about k =560) fall within the visible range but are simply not plotted. $\endgroup$ – Sjoerd C. de Vries Jan 22 '14 at 20:41

You need to evaluate numerically the points, using N[]. Morevoer, I always suggest you to use the PlotRange->All option for ListPlot. Here is the code:

p1 = Table[(Binomial[2000, k]*StirlingS2[1386, k]*k!)/(2000^1386), {k,1, 1386, 1}] 

ListPlot[p1 // N, PlotRange -> All]

This shows all the values starting from k=1.

|improve this answer|||||
  • $\begingroup$ Now everything works good. Thank you, from now on I will remember using N[]. $\endgroup$ – Ziva Jan 22 '14 at 20:02
  • 1
    $\begingroup$ @ziva Usually, ListPlot works just fine without N, but the numbers in your table are a bit extreme (just have a look at p[[1]] and p[[800]]) and I think ListPlot removes the smallest/most hopeless cases. Cases[ListPlot[p1, PlotRange -> All], Point[p___] :> Length@p, Infinity] shows that there are 849 points in the arbitrary precision plot. If you use p1//N in the above you'll see you have 1386 points instead. $\endgroup$ – Sjoerd C. de Vries Jan 22 '14 at 20:32

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