       Re: Problem with RegionFunction

• To: mathgroup at smc.vnet.net
• Subject: [mg88049] Re: [mg88031] Problem with RegionFunction
• From: John Fultz <jfultz at wolfram.com>
• Date: Wed, 23 Apr 2008 04:06:42 -0400 (EDT)

```On Tue, 22 Apr 2008 06:28:53 -0400 (EDT), zac wrote:
> Dear Group,
>
> any idea what is the problem with the output of this Manipulate?
>
> Manipulate[
> Plot3D[Sin[x]*Cos[y],{x,1,10},{y,2,10},RegionFunction->Function[{x,y},
> 45<=(y^x)]]
> ,{dummy,{True,False}}]
>
> Interestingly none of the following codes produces errors:
>
> Plot3D[Sin[x]*Cos[y], {x, 1, 10}, {y, 1, 10},
> RegionFunction -> Function[{x, y}, 45 <= (y^x)]]
>
> Manipulate[
> Plot3D[Sin[x]*Cos[y], {x, 1, 10}, {y, 1, 10},
> RegionFunction -> If[region, All, Function[{x, y}, 45 <= (y^x)]]]
> , {region, {True, False}}]
>
> Any suggestion would be appreciated.
> Istvan Zachar

However, this code does produce the error...

Plot3D[Sin[x]*Cos[y], {x, 1, 10}, {y, 2, 10},
RegionFunction -> Function[{x, y}, 45 <= (y^x)],
PerformanceGoal -> "Speed"]

and this version of the Manipulate is error-free...

Manipulate[
Plot3D[Sin[x]*Cos[y], {x, 1, 10}, {y, 2, 10},
RegionFunction -> Function[{x, y}, 45 <= (y^x)],
PerformanceGoal -> "Quality"], {dummy, {True, False}}]

Although the final image in Manipulate is produced with
PerformanceGoal->"Quality", intermediate images are produced with
PerformanceGoal->"Speed".  It looks like the error-handling between the two is
getting confused here.

But, in your case, the problem is easy to work around, although the work-around
will produce a slower Manipulate if your Manipulate requires forcibly
regenerating this Plot3D.

Sincerely,

John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.

```

• Prev by Date: Re: Re: Converting Power terms to Times terms
• Next by Date: Re: installing Playe rPro killed using Mathematica itself: BEWARE!
• Previous by thread: Re: Problem with RegionFunction
• Next by thread: Re: Problem with RegionFunction