MATLAB: Transparency causes nonsmooth lines

smooth

When I set transparency in the figure, the original smooth line becomes nonsmooth.
[x,y] = meshgrid(-2:.2:2);
z = x.*exp(-x.^2-y.^2);
a = gradient(z);
figure; surf(x,y,z,'AlphaData',a,'FaceAlpha','flat','FaceColor','blue');
figure; surf(x,y,z)

Best Answer

Transparency requires the OpenGL renderer. The line-smoothing requires the Painters renderer. As far as I can see, you observe the expected behavior.