# 3D plots like in MuPAD

The finest 3D surface plots I've seen so far were created with MuPAD, which has been discontinued for many years unfortunately. Here's an example:

How can I achieve similar results with Mathematica? I care about the quality of the surface shading. The contour plot on the bottom isn't relevant here.

• You could try POVRay. Feb 17, 2018 at 14:55
• Can you please provide the equation of this surface in MA format. Feb 17, 2018 at 16:28
• That's true, MuPAD's graphics defaults were quite nice. (The rest was quite inefficient and unwieldy, though.) In Mathematica, you can add specular effects by injecting Specularity directives though the PlotStyle option into Plot3D. The plot shown above contains also several (white) light sources. These can be set through the option Lighting. Feb 17, 2018 at 17:44
• mupad was not discontinued. It was bought by Mathworks. (after Mathworks stopped using Maple as its math symbolic engine). I still use it from time to time from inside Matlab. as was mentioned above, it might have good graphics, but it is not too strong in other areas as integration and differential equations. see for example how it did against Mathematica and others in integration tests here Feb 17, 2018 at 20:24
• Just for reference, Asymptote gives very nice results too. See e.g. this or this. Feb 19, 2018 at 1:05

Not exactly, but maybe a good start

xmx = 1;
CoolColor[ z_ ] := RGBColor[z, 1 - z, 1];
f = x^3 - 3 x y^2;
surf = Plot3D[f, {x, -xmx, xmx}, {y, -xmx, xmx}, AspectRatio -> 0.8,
PlotRange -> {-xmx, xmx} , PlotPoints -> 50, ClippingStyle -> None,
Mesh -> 20, PlotStyle -> Directive[Specularity[White, 100]],
ColorFunction -> CoolColor, Lighting -> {None, "Directional"}];
slice = SliceContourPlot3D[f - xmx,
z == -xmx, {x, -xmx, xmx}, {y, -xmx, xmx}, {z, -xmx, xmx},
Contours -> 16, ContourShading -> None, ContourStyle -> Red];
Show[surf, slice, Axes -> {False, False, False}, ImageSize -> 800]


Playing with other parameters and adding the antialiasing I got the following

surf = Plot3D[f, {x, -xmx, xmx}, {y, -xmx, xmx}, AspectRatio -> 0.9,
PlotRange -> {-xmx, xmx}, PlotPoints -> 50,
ClippingStyle -> None, Mesh -> 20,
ColorFunction -> (Directive[Specularity[0.5, 20], Glow@CoolColor[#]] &),
Lighting -> {{"Spot", White, Scaled[{r Cos[p] Sin[t], r Sin[p] Sin[t], r Cos[t]}], a}},
PerformanceGoal -> "Quality"] /. {r -> 0.7, p -> 4, t -> 0.4, a -> 0.75};
slice = SliceContourPlot3D[f - xmx,
z == -xmx, {x, -xmx, xmx}, {y, -xmx, xmx}, {z, -xmx, xmx},
Contours -> 16, ContourShading -> None, ContourStyle -> Red];
gr = Show[surf, slice, Axes -> {False, False, False},
ImageSize -> 300]


• Thank you, it's a start! Somehow the MuPAD one looks even more glossy. I don't know what it is, sharper specularity, more diffuse shading, several light sources?? Feb 18, 2018 at 15:22
• @user55344 I think they have indeed 3 light sources. I've used only one. Feb 18, 2018 at 15:32
• @user55344 In v12.3 Lighting ->"ThreePoint" is introduced. May 21, 2021 at 7:01