4
$\begingroup$

Please compare the output of these two similar codes:

ListPlot[Table[(n + 2)/(3 n), {n, 1, 50}], AxesOrigin -> {0, 0}, PlotRange -> All]
ListPlot[Table[(2 n + 2)/(3 n), {n, 1, 50}], AxesOrigin -> {0, 0}, PlotRange -> All]

I believe this is a bug. I use Mathematica 10.0.2.

$\endgroup$
  • $\begingroup$ looks fine using M9. $\endgroup$ – penguin77 Apr 12 '15 at 13:42
  • 1
    $\begingroup$ Indeed in 10.0.2 x-axis is missing. $\endgroup$ – Kuba Apr 12 '15 at 13:45
  • 2
    $\begingroup$ a work-around: Show[ListPlot[Table[(2 n + 2)/(3 n), {n, 1, 50}]], AxesOrigin -> {0, 0},PlotRange -> All] $\endgroup$ – kglr Apr 12 '15 at 14:20
2
$\begingroup$

I don't think this is a bug. According to the Help system:

PlotRange -> All ........ all points are included

And in both your plots, all points are included. If you want your custom location for the axes to be included and visible in the plot, then you need to specify this requirement in the PlotRange setting, say:

PlotRange -> {0, All}

For example:

ListPlot[Table[(2 n + 2)/(3 n), {n, 1, 50}], AxesOrigin -> {0, 0}, 
  PlotRange -> {0, All}]

enter image description here

... includes All points, starting the vertical from 0, so that the axes location that you have manually specified are visible.

$\endgroup$
  • $\begingroup$ This might be true, but in general, if you have e.g. a plot of Sin[a x] inside Manipulate with a as manipulated parameter, specifying PlotRange will become a nightmare because sometimes you want to use All to prevent clipping the negative part, and sometimes you need to specify 0 to make x axis visible. $\endgroup$ – Ruslan May 4 '15 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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