# Why does one Monitor expression work while another fails?

I have a (somewhat involved) function f[x?NumericQ, y?NumericQ] and for some reason it behaves differently when given a Table than when given a RegionPlot.

Monitor[Table[f[x, y] > 2, {x, 2, 50, 1}, {y, 0, 500, 1}], {x, y}]


shows the values of x and y as the grid is scanned and returns the table. However,

Monitor[RegionPlot[f[x, y] > 2, {x, 2, 50}, {y, 0, 500}], {x, y}]


returns nothing and the monitor gets stuck on unevaluated x, y after the initial point of the evaluation (close to (2, 0)) has been done.

Any idea about

• What kind of trouble might arise in RegionPlot that did not happen with Table

• How I could investigate what's going on in the RegionPlot

• Look at EvaluationMonitor for RegionPlot...
– ciao
Jun 26 '14 at 23:09
• Also, your second example makes no sense, Tan takes one argument... with proper arguments, you should see proper Monitor results.
– ciao
Jun 26 '14 at 23:25
• eh sorry for the argument of Tan, cut-paste error. Jun 26 '14 at 23:32
• there was an incongruence in the definition of f[x?NumericQ,y?NumericQ] that is to say f was using other functions were not defined with arguments ?NumericQ. For some reason Table can live up to this and still evaluates correctly the functions, RegionPlot gets stuck at trying to evaluate the function. I am wondering if I cooked up a strange thing that makes them behave differently or it is the way it is supposed to be ... Jun 26 '14 at 23:36

## 1 Answer

You really have to slow RegionPlot down a lot to see the monitor output. The following is slow enough that you can see the values of x and y change as the plot algorithm builds it mesh.

f[x_, y_] := (Pause[.01]; x y)
Monitor[RegionPlot[f[x, y] > 20000, {x, 0, 500}, {y, 0, 500}], {x, y}]