Problems with fill, my object overlaps
显示 更早的评论
Hello,
I'm having a problem using the fill function, I have also tried using patch and get the same results.
Basically I'm plotting a path and I want the area I cover with the path to be one colour and the uncovered area another colour, pretty simple eh?
Well all goes well until the path overlaps it's self, then the overlapped area returns to the background colour producing a strange checkerbox type effect.
I have solved this but plotting sections of my path seperately however this adds to the computational time and I need this graph to be plotted in real time, so I would really appreciate if any one could other some advice.
I have the co-ords of left side on the path in a matrix "left" and the right side in "right", then I'm drawing the path to pint i using
fill([right(1,1);left(1:i,1)right((i+1)-(1:i),1)],[right(1,2);left(1:i,2)right((i+1)-(1:i),2)],'r');
I'm sure other people must have had this problem too, thanks very much in advance.
Gareth
1 个评论
Helena Hjørringgaard
2022-5-18
I know your post is very old, but did you ever manage to get it fixed? I have the same problem.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!