       Re: 3D plot with range restricted to non-rectangular region

• To: mathgroup at smc.vnet.net
• Subject: [mg66125] Re: 3D plot with range restricted to non-rectangular region
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Sun, 30 Apr 2006 04:21:36 -0400 (EDT)
• References: <e2v6od\$neh\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,

no really but

Off[ParametricPlot3D::pplr]
gr = ParametricPlot3D[{x, y,
h[x, y, 1 - x - y]}, {y, 0, 1}, {x, 0, 1}, DisplayFunction -> Identity];
Show[Graphics3D[
Cases[gr, p_Polygon /; FreeQ[p, Indeterminate], Infinity]]]

Regards
Jens

David Sanders wrote:
> Hi,
>
> I want to plot a function whose range is naturally restricted to a
> non-rectangular region:
>
> h[x_, y_, z_] := Log[x] + Log[y] + Log[z]
>
> h2[x_, y_] := h[x, y, 1 - x - y]
>
> Only the region {(x,y): 0<x<1; 0<y<1-x}  is allowed.
>
> If I try the naive
> Plot3D[h2[x, y], {x, 0, 1}, {y, 0, 1}]
>
> then I get error messages of the type:
>
> Plot3D::plnc: h2[x, y] is neither a machine-size real number at {x,
> y}={0.5, \
> 0.5} nor a list of a real number and a valid color directive
>
> But then it plots the graph anyway.
>
> I also need contour plots of functions like this.
>
> Is there a proper way of avoiding these error messages, like making it
> ignore points whenever they contain an illegal operation (here, Log of
> a negative number)?
>
> Thanks,
> David.
>

```

• Prev by Date: Re: Conditions with Statistical Functions
• Next by Date: Re: 2D/3D plots scaled to unit of dimension
• Previous by thread: Re: 3D plot with range restricted to non-rectangular region
• Next by thread: Re: 3D plot with range restricted to non-rectangular region