Hi,
I need to be able to fill pattern in each polygon. Right now, it is filling colours.
clear all;
clc;
A = [0.01 1.88
0.05 1.92
0.082 1.88
0.10 1.60
0.15 1.23
0.20 1.00
0.25 1.00
0.50 1.00
0.75 1.00
0.99 1.00 ] ;
pgon1 = polyshape([0.01 .082 .082 0.05 0.01],[1 1 1.88 1.92 1.881])
plot(pgon1)
hold on
pgon2 = polyshape([0.082 0.2 .15 .1 .082],[1 1 1.23 1.6 1.88])
plot(pgon2)
pgon3 = polyshape([0.2 .99 .99 .082 .082 .1 .15 .2],[1 1 2 2 1.88 1.6 1.23 1])
plot(pgon3)
pgon4 = polyshape([0.01 0.05 .082 .082 0.01],[1.88 1.92 1.88 2 2])
plot(pgon4)
xlim([0.01 .99]);
ylim([1 2]);
xticks([0.01 0.082 .25 .5 .75 .99])
xticklabels({'0.01','0.082','0.25','0.50','0.75','0.99'})

댓글 수: 3

darova
darova 2019년 6월 6일
Use fill() or patch()
Milan Kumar
Milan Kumar 2019년 6월 6일
How?
can you please help with just one area.
darova
darova 2019년 6월 6일
Easy enough: patch(x,y,'color',[0.5 0.1 0.2])
Use help
patch(A(:,1),A(:,2),'c')

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Elementary Polygons에 대해 자세히 알아보기

태그

질문:

2019년 6월 6일

댓글:

2019년 6월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by