Re: ContourPlot non rectangular evaluation?

• To: mathgroup at smc.vnet.net
• Subject: [mg127839] Re: ContourPlot non rectangular evaluation?
• From: Bob Hanlon <hanlonr357 at gmail.com>
• Date: Sun, 26 Aug 2012 02:50:22 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net
• References: <20120825082641.60C04689F@smc.vnet.net>

```Try the option Exclusions or using Boole

f[x_, y_] = Sin[x + y];
g[x_, y_] = x - y;
h[x_, y_] = f[x, y]/g[x, y];

ContourPlot[h[x, y],
{x, -Pi, Pi}, {y, -Pi, Pi}] //
Quiet

ContourPlot[h[x, y],
{x, -Pi, Pi}, {y, -Pi, Pi},
Exclusions -> {g[x, y] == 0}] //
Quiet

ContourPlot[h[x, y]*
Boole[g[x, y] != 0],
{x, -Pi, Pi}, {y, -Pi, Pi}] //
Quiet

Bob Hanlon

On Sat, Aug 25, 2012 at 4:26 AM, Sam McDermott <samwell187 at gmail.com> wrote=
:
> Hi,
>
> I'd like to make a plot of level curves of a function, but this function =
becomes singular and passes from infinity to negative infinity, which reall=
y uglifies the plot. It is easy for me to identify where the function becom=
es singular (i.e., when the denominator becomes 0!), but I'm having trouble=
telling Mathematica to stop evaluating before then, because this singulari=
ty is sensitive to both of the variables on the axes of my ContourPlot. Is =
there a simple way of telling Mathematica where to stop?
>
> In other words,  I have some function
>
> h[x_,y_]:=f[x,y]/g[x,y]
>
> and I can numerically find the zeroes of g[x,y]. Can I make a ContourPlot=
such that
>
> ContourPlot[h[x,y],{x,xmin,xmax},{y,ymin,ymax}]
>
> does not evaluate below the curve
>
> g[x,y]=0
>
> ?
>
> I think I'm basically looking for some way of setting assumptions of eval=
uating an "If" conditional inside of ContourPlot but can't find a good way =
of doing it. Any help would be much appreciated!
>
> Thanks very much for your time!
>
> -Sam
>

```

• Prev by Date: Re: ContourPlot non rectangular evaluation?
• Next by Date: Re: ContourPlot non rectangular evaluation?
• Previous by thread: ContourPlot non rectangular evaluation?
• Next by thread: Re: ContourPlot non rectangular evaluation?