我喜欢Mathematica 5中安静且不受干扰的色域和 3D 绘图照明。
是否可以像在Mathematica 5 中一样在Mathematica 7中设置 3D 绘图的样式?
Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}, ImageSize -> 360]
<< Version5`Graphics`
Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}, ImageSize -> 360]
此代码允许轻松比较版本 5 和版本 7 图形的视觉外观:
v5style = {{"Ambient", RGBColor[{0.356, 0.294, 0.4}]}, {"Directional",
RGBColor[{0.56, 0., 0.}],
ImageScaled[{2, 0, 2}]}, {"Directional", RGBColor[{0., 0.56, 0.}],
ImageScaled[{2, 2, 2}]}, {"Directional",
RGBColor[{0., 0., 0.56}], ImageScaled[{0, 2, 2}]}};
PostScriptGraphics /: MakeBoxes[PostScriptGraphics[str_String], _] :=
Cell[GraphicsData["PostScript", str], CellAutoOverwrite -> True,
CellBaseline -> Center]
v5vsv7[\[Theta]_] := {Developer`LegacyGraphics[];
v5Graphics =
Graphics`Legacy`Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi},
ImageSize -> 360,
ViewPoint -> RotationTransform[\[Theta], {0, 0, 1}][{3, 0, 3}]];
v5PostScript = ExportString[v5Graphics, "APS"];
Developer`SymbolicGraphics[];
PostScriptGraphics[v5PostScript],
Graphics3D[First@Graphics3D@v5Graphics,
FilterRules[Last@Graphics3D@v5Graphics, Options[Graphics3D]],
ViewPoint -> RotationTransform[\[Theta], {0, 0, 1}][{3, 0, 3}],
PlotRangePadding -> None,
ImageSize -> 360] /. (Lighting -> _) -> (Lighting -> v5style)};
Grid@Table[v5vsv7[\[Theta]], {\[Theta], 0, 2 Pi, Pi}]