MathGroup Archive 2006

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

Search the Archive

Re: Plot3D: plot does not display when PlotPoints different from 25. Mathematica 5.2

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65795] Re: Plot3D: plot does not display when PlotPoints different from 25. Mathematica 5.2
  • From: Farhat Habib <farhat at hotmail.com>
  • Date: Mon, 17 Apr 2006 02:28:51 -0400 (EDT)
  • Organization: Ohio State University
  • References: <e1stnb$bk7$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

nma at 12000.org wrote:
> [This post has been delayed due to email problems - moderator]
> 
> 
> Remove["Global`*"]
> 
> u[x_, y_] := Module[{},
>     If[x == 0, Return[1 + y]];
>     If[y == 0, Return[1]];
>     Return[0];
> ]
> 
> Plot3D[u[x, y], {x, -1, 2}, {y, -1, 2},
>   FaceGrids -> None,
>   AxesLabel -> {"U(x,y)", "x", "y"},
>   PlotLabel -> "Boundary conditions",
>   PlotPoints -> 25]
> 
> works OK. But if you change 25 to say 26 in the last line above, the
> plot does not show up any more !
> 
> Can someone explain why this is?
> 
> thanks,
> Nasser Abbasi
> 

Its because of the way the points are sampled from the range {-1,2}. If 
x=0, or y=0 aren't one of the points at which Mathematica is sampling 
the function then the plot will be uniformly zero. If you put 
PlotPoints->49, e.g., you will se the desired plot.

-F


  • Prev by Date: Re: Beginner--Programming Problem with "if"
  • Next by Date: Re: Plot {x,y} and {x,z} of a List {x,y,z}
  • Previous by thread: Re: Plot3D: plot does not display when PlotPoints different from 25. Mathematica 5.2
  • Next by thread: normalization and square roots