[英]How do you remove the intersection curve between two translucent surfaces
I am plotting two surfaces using surf
and the FaceAlpha
parameter. 我正在使用
surf
和FaceAlpha
参数绘制两个曲面。 When FaceAlpha
is less than 1, the surfaces are translucent and the curve of intersection shows up in white. 当
FaceAlpha
小于1时,表面是半透明的,交叉曲线显示为白色。 Why does this happen, and how do you remove it? 为什么会发生这种情况,如何将其删除?
Code to reproduce in 2015b: 在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. 这似乎是OpenGL的一个问题。 Change the renderer to
painters
and the white line disappears: 将渲染器更改为
painters
,白线消失:
set(gcf, 'Renderer', 'painters')
(tested on Mac OS 10.11.1 and MATLAB 2015b) (在Mac OS 10.11.1和MATLAB 2015b上测试)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.