Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Shading in Plot3D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113023] Re: Shading in Plot3D
  • From: Helen Read <readhpr at gmail.com>
  • Date: Mon, 11 Oct 2010 05:17:23 -0400 (EDT)
  • References: <i8s5ej$93f$1@smc.vnet.net>
  • Reply-to: HPR <read at math.uvm.edu>

On 10/10/2010 6:44 AM, R Martinez wrote:
> All,
>
> I want to use Plot3D to produce a surface with no shading. All I want is a black-and-white plot: black meshlines and a white surface.
>
> But no matter what I try, I get gray shading. I've done my due diligence in the Documentation Center, but can't find the key to turn off all shading.
>
> Can anyone help?
>
> Here's the Plot3D command I'm using, which gives me a white surface with the black meshlines, but with the unwanted shading.
>
> Plot3D[Sin[x y], {x, -Pi, Pi}, {y, -Pi, Pi}, PlotPoints ->  Automatic,
>   Mesh ->  {{-Pi/2, 0, Pi/2}, {-Pi/2, 0, Pi/2}},
>   MeshStyle ->  {{Black, Thickness[0.004]}, {Black, Thickness[0.004]}},
>   PlotRange ->  {All, All, All}, BaseStyle ->  {FontSize ->  12, Bold},
>   Boxed ->  False, PlotRegion ->  {{0.025, 0.975}, {0.025, 0.975}},
>   MeshShading ->  None, Exclusions ->  None, ColorFunction ->  {White}]

One of the examples in the Documentation for Plot3D, under Options, 
PlotStyle says

Produce a wire mesh: PlotStyle->None

A few other comments about what you have:

PlotPoints->Automatic is the default behavior. You do not need to 
specify it.

There is also no need for PlotRange->{All,All,All} in your example.

The default color for MeshStyle is Black, so you need only specify the 
thickness.


So try this:

Plot3D[Sin[x y], {x, -Pi, Pi}, {y, -Pi, Pi}, PlotStyle -> None,
  MeshStyle -> {Thickness[.004], Thickness[.004]},
  Mesh -> {{-Pi/2, 0, Pi/2}, {-Pi/2, 0, Pi/2}},
  BaseStyle -> {FontSize -> 12, Bold}, Boxed -> False]


I'm not at all sure what you are trying to achieve with PlotRegion, 
which is an option for two dimensional plots. If you to plot only over a 
specific region, the way to do that is with RegionFunction. For example, 
this will plot the surface over the unit disk.

Plot3D[Sin[x y], {x, -Pi, Pi}, {y, -Pi, Pi},
  RegionFunction -> Function[{x, y, z}, x^2 + y^2 <= 1]]

And if you want only a wire mesh:

Plot3D[Sin[x y], {x, -Pi, Pi}, {y, -Pi, Pi},
  RegionFunction -> Function[{x, y, z}, x^2 + y^2 <= 1],
  PlotStyle -> None]


-- 
Helen Read
University of Vermont


  • Prev by Date: Re: Lists and Loops
  • Next by Date: Travelling Salesman Problem with LinearProgramming
  • Previous by thread: Re: Shading in Plot3D
  • Next by thread: double loop