1
$\begingroup$

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

$\endgroup$
4
  • 1
    $\begingroup$ Look at EvaluationMonitor for RegionPlot... $\endgroup$
    – ciao
    Jun 26 '14 at 23:09
  • 1
    $\begingroup$ Also, your second example makes no sense, Tan takes one argument... with proper arguments, you should see proper Monitor results. $\endgroup$
    – ciao
    Jun 26 '14 at 23:25
  • 1
    $\begingroup$ eh sorry for the argument of Tan, cut-paste error. $\endgroup$
    – Rho Phi
    Jun 26 '14 at 23:32
  • $\begingroup$ 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 ... $\endgroup$
    – Rho Phi
    Jun 26 '14 at 23:36
1
$\begingroup$

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}]

region

$\endgroup$

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.