I am plotting two surfaces using surf and the FaceAlpha parameter. When FaceAlpha is less than 1, the surfaces are translucent and the curve of intersection shows up in white. Why does this happen, and how do you remove it?

Code to reproduce in 2015b:
x = linspace(0, 1, 21);
y = linspace(0, 1, 21);
[x, y] = meshgrid(x, y);
z1 = x;
z2 = y;
hold off
surf(x, y, z1, 'FaceAlpha', 0.2)
hold on
surf(x, y, z2, 'FaceAlpha', 0.2)
Contrast this with:
hold off
surf(x, y, z1)
hold on
surf(x, y, z2)
This seems to be a problem with OpenGL. Change the renderer to painters and the white line disappears:
set(gcf, 'Renderer', 'painters')
(tested on Mac OS 10.11.1 and MATLAB 2015b)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With