4
$\begingroup$

Bug introduced in 10.0.0 and fixed in 10.0.1


Version 10:

This works:

  grids[min_, max_] := Table[If[EvenQ[i], {i, Red}, {i, Blue}], 
       {i, Ceiling[min], Floor[max], 1}];
  Plot[Sin[x], {x, -Pi, Pi}, GridLines -> grids]

Mathematica graphics

But when used with LogPlot it gives an error:

LogPlot[x^x, {x, 1, 5}, GridLines -> grids]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Nuts; so I can't even use a custom function! :-S $\endgroup$ – Mr.Wizard Jul 12 '14 at 9:10
  • $\begingroup$ @Mr.Wizard WRI wants to make it really hard not to have nice log spaced gridlines for LogPlot :) $\endgroup$ – Nasser Jul 12 '14 at 9:11
  • $\begingroup$ Related: (54578) $\endgroup$ – Mr.Wizard Jul 12 '14 at 9:11
  • $\begingroup$ Related: (4066) $\endgroup$ – m0nhawk Jul 12 '14 at 9:29
  • 3
    $\begingroup$ I've reported the issue for Wolfram Support, [CASE:1212405]. $\endgroup$ – m0nhawk Jul 12 '14 at 10:11
2
$\begingroup$

For LogPlot and LogLogPlot you need to specify both grids, vertical and horizontal.

grids[min_, max_] := 
  Table[If[EvenQ[i], {i, Red}, {i, Blue}], {i, Ceiling[min], 
    Floor[max], 1}];
LogPlot[x^x, {x, 1, 5}, GridLines -> {grids, Automatic}]

enter image description here

And for {grids, None}:

enter image description here

$\endgroup$
  • 2
    $\begingroup$ Interesting observation, but what about grid-lines for the log direction? GridLines -> {grids, grids} does not work. $\endgroup$ – Mr.Wizard Jul 12 '14 at 9:31

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.