How to colour code polygons by area?
显示 更早的评论
Hi,
I have generated a Voronoi diagram and calculated the areas of the polygons formed. I now want to colour code my polygons by area, for example, for areas between 10-20, colour this red. Then 20-30 blue... etc. Ideally, I would like to have a continous colour fade from smallest-largest polygon area. Could someone please shed some light on how to do this. I have currently used the patch(x,y,c) function, but this does not colour by area. Thanks in advance.
采纳的回答
更多回答(1 个)
Image Analyst
2015-10-22
0 个投票
It's easy to do if you convert it to an image. Just call bwlabel(), regionprops(), sort(), and intlut(). Do you have the Image Processing Toolbox.
类别
在 帮助中心 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

