MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Exclusions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87997] Re: Exclusions
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Mon, 21 Apr 2008 14:37:26 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <fuhqv0$rgt$1@smc.vnet.net>

Fiona H Evans wrote:
> I'm having a little trouble with the use of "Exclusions" for plotting.
> 
> If I use "Exclusions -> Automatic" in the following, Plot3D finds no
> exclusions.
> 
> pdfN[{x_, y_} := PDF[MultinormalDistribution[{0, 0}, {{1, 0}, {0,
===============^^
Syntax error: a square bracket is missing.
------------------------------------------

> 1}}], {x, y}];
> 
> grayColors = Function[{x, y, z}, (Lighter[Gray, #] &)[z]];
> 
> Plot3D[ pdfN[{x, y}], {x, -3, 3}, {y, -3, 3}, PlotRange -> Full,
>  Mesh -> 30,  ColorFunction -> grayColors, PlotPoints -> 50,
>  Exclusions -> Automatic,
>  ExclusionsStyle -> {None, Directive[Thick, Red]}, MaxRecursion -> 0,
>  AxesLabel -> {"x", "y"}]
> 
> However, if I try to exclude a cross-section through the mean of the
> distribution asin the following, as well as my defined Exclusions, I
> get an exclusion drawn at {y == 0, x < 0}, even though I have used
> inequalities to exclude y == 0 from my Exclusions.
> 
> Plot3D[ pdfN[{x, y}], {x, -3, 3}, {y, -3, 3}, PlotRange -> Full,
>  Mesh -> 30,  ColorFunction -> grayColors, PlotPoints -> 50,
>  Exclusions -> {{ArcTan[x, y] == 0.5, x > 0 && y > 0}, {ArcTan[x, y]
> == -Pi + 0.5, x < 0 &7 y < 0}},
======================^^
Very likely typo: should be double ampersand sign if logical AND is 
intended. As written, you check whether the product of a pure function 
by seven times y is less than zero.
----------------------------------------------------------------------

>  ExclusionsStyle -> {None, Directive[Thick, Red]}, MaxRecursion -> 0,
>  AxesLabel -> "x", "y"}]
===============^^
Syntax error: a curly bracket is missing.
-----------------------------------------

> Can anyone see a way that I can avoid this?
> 
> Regards, Fiona.

"Exclusions -> Automatic" excludes subregions associated with 
discontinuities. Since the function you posted is continuous, why do you 
expect to get any exclusion with this setting?

Anyway, you may be more interested in the option *RegionFunction*, 
which specifies the region to include in the plot drawn.

You will find below a syntacticly correct version of your code.

Needs["MultivariateStatistics`"]

pdfN[{x_, y_}] :=
   PDF[MultinormalDistribution[{0, 0}, {{1, 0}, {0, 1}}], {x, y}];

Plot3D[pdfN[{x, y}], {x, -3, 3}, {y, -3, 3}]

grayColors = Function[{x, y, z}, (Lighter[Gray, #] &)[z]];

Plot3D[pdfN[{x, y}], {x, -3, 3}, {y, -3, 3}, PlotRange -> Full,
  Mesh -> 30, ColorFunction -> grayColors, PlotPoints -> 50,
  Exclusions -> Automatic,
  ExclusionsStyle -> {None, Directive[Thick, Red]}, MaxRecursion -> 0,
  AxesLabel -> {"x", "y"}]

Plot3D[pdfN[{x, y}], {x, -3, 3}, {y, -3, 3}, PlotRange -> Full,
  Mesh -> 30, ColorFunction -> grayColors, PlotPoints -> 50,
  Exclusions -> {{ArcTan[x, y] == 0.5,
     x > 0 && y > 0}, {ArcTan[x, y] == -Pi + 0.5, x < 0 && y < 0}},
  ExclusionsStyle -> {None, Directive[Thick, Red]}, MaxRecursion -> 0,
  AxesLabel -> {"x", "y"}]

Regards,
-- Jean-Marc



  • Prev by Date: Re: Re: Timing
  • Next by Date: Re: Re: Timing
  • Previous by thread: Exclusions
  • Next by thread: Re: Exclusions