# ReplaceAll on a Plot - Can you reproduce this error?

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).

• 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 Oct 12 '19 at 13:25
• 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 _?SystemDumpHeldNumericQ instead. This function prevents its argument from evaluating, so the issue does not occur Oct 12 '19 at 13:39
• I was able to reproduce with v12.0.0.0 on macOS Catalina 10.15 Oct 12 '19 at 17:09