From: d Milthon on 7 Jun 2010 10:10 I have a polygon inside a polygon (polygon with a 'hole') and I'm trying to use the patch command (in my GUI) to color only the big polygon without the inner hole so i need to color the bigger one (doesn't matter what color) and the smaller polygon needs to be white (or background color) so it would look like a hole inside a polygon. i tried: p=patch(x,y,z,'w'); clear z z = [3 37]; set(p,'FaceColor','flat','CData',z,'CDataMapping','scaled') but i can only give strange colors to the faces, not white as i need. Does anyone know a fast way with patch ?
From: Walter Roberson on 7 Jun 2010 11:02 d Milthon wrote: > I have a polygon inside a polygon (polygon with a 'hole') and > I'm trying to use the patch command (in my GUI) to color only the big > polygon without the inner hole so i need to color the bigger one > (doesn't matter what color) and the smaller polygon needs to be white > (or background color) so it would look like a hole inside a polygon. > > i tried: > p=patch(x,y,z,'w'); > clear z > z = [3 37]; > set(p,'FaceColor','flat','CData',z,'CDataMapping','scaled') > > but i can only give strange colors to the faces, not white as i need. > > Does anyone know a fast way with patch ? I suggest you see http://www.mathworks.com/access/helpdesk/help/techdoc/ref/patch.html#br92bi7-17 and look at the examples for "Specifying Face Colors Using x-, y-, and z-Coordinate Input"
|
Pages: 1 Prev: Gui pushbutton Next: Fastest possible way to convert non-numbers to zeros? |