13
$\begingroup$

According the documentation for Show:

  • Options explicitly specified in Show override those included in the graphics expression.
  • The lists of non-default options in the Subscript[g, i] are concatenated.

In the three plots below, the Lighting option(s) of the components are placed in different arguments:

  • p1 has the Lighting option added to Show.
  • p2 has the Lighting option in each component plot.
  • p3 has the Lighting option in the first component plot only.

The resulting plots are pairwise different in V10.0.0+ (up to V10.2 currently). The plots are all the same in V9.0.1. (Mac OS.)

Clear[f];
f[t_, z_] := Cos[z/2]^0.5*(1 + HeavisideTheta[z - 0.35 Pi]);
r1 = f[0, z] /. HeavisideTheta -> (0 &) /. z -> 0.35 Pi;
r2 = f[0, z] /. HeavisideTheta -> (1 &) /. z -> 0.35 Pi;

p1 = Show[ (* Lighting -> ... added in Show *)
   ParametricPlot3D[{f[t, z] Cos[t], f[t, z] Sin[t], -z},
    {t, -Pi, Pi}, {z, -Pi, 0.35 Pi}, Mesh -> None, PlotStyle -> Specularity[0]],
   ParametricPlot3D[{f[t, z] Cos[t], f[t, z] Sin[t], -z},
    {t, -Pi, Pi}, {z, 0.35 Pi, Pi}, Mesh -> None, PlotStyle -> Specularity[0]],
   ParametricPlot3D[{r Cos[t], r Sin[t], -0.35 Pi},
    {t, -Pi, Pi}, {r, r1, r2}, Mesh -> None, PlotStyle -> Specularity[0]],
   PlotRange -> All,
   Lighting -> {{"Directional", RGBColor[1, 1, 1], {-4, 0, 4}}}(*****)];
p2 = Show[ (* Lighting -> ... in each plot *)
   ParametricPlot3D[{f[t, z] Cos[t], f[t, z] Sin[t], -z},
    {t, -Pi, Pi}, {z, -Pi, 0.35 Pi}, Mesh -> None, PlotStyle -> Specularity[0],
    Lighting -> {{"Directional", RGBColor[1, 1, 1], {-4, 0, 4}}}(*****)],
   ParametricPlot3D[{f[t, z] Cos[t], f[t, z] Sin[t], -z},
    {t, -Pi, Pi}, {z, 0.35 Pi, Pi}, Mesh -> None, PlotStyle -> Specularity[0],
    Lighting -> {{"Directional", RGBColor[1, 1, 1], {-4, 0, 4}}}(*****)],
   ParametricPlot3D[{r Cos[t], r Sin[t], -0.35 Pi},
    {t, -Pi, Pi}, {r, r1, r2}, Mesh -> None, PlotStyle -> Specularity[0],
    Lighting -> {{"Directional", RGBColor[1, 1, 1], {-4, 0, 4}}}(*****)],
   PlotRange -> All];
p3 = Show[  (* Lighting -> ... in first plot only *)
   ParametricPlot3D[{f[t, z] Cos[t], f[t, z] Sin[t], -z},
    {t, -Pi, Pi}, {z, -Pi, 0.35 Pi}, Mesh -> None, PlotStyle -> Specularity[0], 
    Lighting -> {{"Directional", RGBColor[1, 1, 1], {-4, 0, 4}}}(*****)],
   ParametricPlot3D[{f[t, z] Cos[t], f[t, z] Sin[t], -z},
    {t, -Pi, Pi}, {z, 0.35 Pi, Pi}, Mesh -> None, PlotStyle -> Specularity[0]],
   ParametricPlot3D[{r Cos[t], r Sin[t], -0.35 Pi},
    {t, -Pi, Pi}, {r, r1, r2}, Mesh -> None, PlotStyle -> Specularity[0]],
   PlotRange -> All];

Here are the output of V10.0.0+ (top row) and V9.0.1 (bottom row):

GraphicsRow[{p1, p2, p3}]

Mathematica graphics

Is this a bug or an undocumented change?


Discovered while investigating questions related to How to avoid these garbage and missing mesh lines in ParametricPlot3D?

$\endgroup$
1
  • $\begingroup$ Related: (54606) $\endgroup$
    – Mr.Wizard
    Jul 21, 2016 at 11:42

1 Answer 1

8
$\begingroup$

This is the result of Plot Themes. This restores the old behavior:

SetOptions[ParametricPlot3D, PlotTheme -> None];

More specifically the default Theme results in embedded Lighting values:

Cases[
 ParametricPlot3D[{f[t, z] Cos[t], f[t, z] Sin[t], -z}, {t, -Pi, Pi}, {z, 0.35 Pi, Pi}, 
  Mesh -> None, PlotStyle -> Specularity[0], PlotTheme -> "Default"],
 HoldPattern[Lighting -> _],
 -1
]
{Lighting -> {{"Ambient", RGBColor[
    0.30100577, 0.22414668499999998`, 0.090484535]}, {"Directional", RGBColor[
    0.2642166, 0.18331229999999998`, 0.04261530000000001], 
    ImageScaled[{0, 2, 2}]}, {"Directional", RGBColor[
    0.2642166, 0.18331229999999998`, 0.04261530000000001], 
    ImageScaled[{2, 2, 2}]}, {"Directional", RGBColor[
    0.2642166, 0.18331229999999998`, 0.04261530000000001], ImageScaled[{2, 0, 2}]}}}

This is not given as a standard option for Graphics3D but within the directives:

{EdgeForm[], RGBColor[0.880722, 0.611041, 0.142051], 
 Lighting -> {{"Ambient", RGBColor[0.301006, 0.224147, 0.0904845]}, {"Directional", 
    RGBColor[0.264217, 0.183312, 0.0426153], ImageScaled[{0, 2, 2}]}, {"Directional", 
    RGBColor[0.264217, 0.183312, 0.0426153], ImageScaled[{2, 2, 2}]}, {"Directional", 
    RGBColor[0.264217, 0.183312, 0.0426153], ImageScaled[{2, 0, 2}]}}, 
 AbsoluteThickness[2], Specularity[0], 
 GraphicsGroup[{Polygon[{{454, 226, 2}, {457, 232, 5}, . . .
$\endgroup$
1
  • 1
    $\begingroup$ Thank you very much! Since V10, I tend to think all plotting problems are due to plot themes. :) Perhaps you have seen the chat discussion of this issue? I am hoping rcollyer will post his view, but I guess we'll see if he feels he has anything to add. $\endgroup$
    – Michael E2
    Jul 30, 2015 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.