Patch does not fill area
18 次查看(过去 30 天)
显示 更早的评论
Hi,
I have an issue with filling a patch area with selected face color. This works as intended in Matlab 2014a, but not in Matlab 2021a for unknown reason. It usethe same data for xPlot, yPlot and zPlot, but still fails in Matlab 2021a.
patch(xPlot,yPlot,zPlot,'g','FaceAlpha',0.2,'Parent',appData.handles.mainax);
Is there a change in patch behaviour I have missed? My other functions creating patched areas are working, it is only this kind of case that is affected.
I have included images for the visual differences. The second image for 2021a is another plot, which has the same issue. It also works in 2014a.
Br
Fredrik Walka
3 个评论
Voss
2022-12-13
编辑:Voss
2022-12-13
Does the patch look filled if you remove the transparency (i.e., remove 'FaceAlpha',0.2, or use 'FaceAlpha',1)?
Another thing: I notice you are using zPlot; does that mean your patch has some non-zero ZData? That is to say, is it a patch in 3 dimensions? Maybe some other object is obscuring it in the Z-direction? Try using the rotate3d tool or setting the axes View to some 3d view and see if the patch changes.
Also, what happens if you change the figure Renderer? E.g., try each of the following separately:
set(gcf,'Renderer','opengl')
set(gcf,'Renderer','painters')
回答(2 个)
Vinayak Choyyan
2022-12-16
Hi Fredrik
A patch is made up of very tiny quadrilaterals. Before 16b, when patch function is used to plot a set of data in 3D mode, the faces parallel to the Z-axis become invisible. Only the faces perpendicular to the Z-axis are visible. There was a check to remove very small quad polygons (that are too small to see)
The problem here is that parts of the scene were made up of very small quads, and the total of those things will be visible, even if individual quads will not.
As a workaround, consider removing the Z-axis coordinates from the input as it looks like your data is 2D.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!