enter image description here

The weird thing is that it occurs only the first time I evaluate it! The same happens with Plot but not with Graphics.

I can reproduce this on Mathematica 11.3 and Wolfram Engine 12 (wolframscript) on Linux Debian 9 (Stretch).

  • 1
    $\begingroup$ The error seems to come from Method -> {"CoordinatesToolOptions" -> {"DisplayFunction" -> \ ({(Identity[#1] &)[#1[[1]]], (Identity[#1] &)[#1[[2]]]} &) but still, weird that it happens only at the first evaluation $\endgroup$
    – Fortsaint
    Oct 12 '19 at 13:25
  • 5
    $\begingroup$ This is due to the fact that the pattern _?NumericQ causes NumericQ to be applied to all the parts of the graphics expression. One of them is the body of the "DisplayFunction", which contains #1[[2]] (which is not wrapped in Function[...], since we're only looking at the body of the function now). This causes the error you observe, but I'm not entirely sure why it only happens once. Presumably, ReplaceAll does some caching somewhere. One way around this is to use _?System`Dump`HeldNumericQ instead. This function prevents its argument from evaluating, so the issue does not occur $\endgroup$
    – Lukas Lang
    Oct 12 '19 at 13:39
  • $\begingroup$ I was able to reproduce with v12.0.0.0 on macOS Catalina 10.15 $\endgroup$
    – Bob Hanlon
    Oct 12 '19 at 17:09

Your Answer

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

Browse other questions tagged or ask your own question.