Consider the following code.
RegionPlot[Print[{x, y}], {x, -2, 2}, {y, -2, 2}, PlotPoints -> 2]
{-1.996,-1.996} {Region`Private`RegionVar[1],Region`Private`RegionVar[2]} {-2.,-2.} {2.,-2.} {-2.,2.} {2.,2.}
My question is: what is RegionPlot
doing to create the first two lines of output? I do not understand why the first sample point is {-1.996, -1.996}
and why the second sample point is {Region`Private`RegionVar[1],Region`Private`RegionVar[2]}
.
I am running this in Mathematica 9. I do not recall this happening in an earlier version.
Edit: I changed the code above to give a better minimal working example. I leave below the code I first gave along with its truncated output.
myFunc[pt_] := Module[ {bool},
bool = Sin[ pt[[1]] ] > 0;
Print[pt, bool];
If[ bool, Return[True], Return[False] ];
];
RegionPlot[myFunc[ {x, y} ], {x, -2, 2}, {y, -2, 2}, PlotPoints -> 2]
{-1.996,-1.996}False {Region`Private`RegionVar[1],Region`Private`RegionVar[2]}Sin[Region`Private`RegionVar[1]]>0 {-2.,-2.}False {2.,-2.}True