Fill pattern in a plot
조회 수: 9 (최근 30일)
이전 댓글 표시
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
2019년 6월 6일
Easy enough: patch(x,y,'color',[0.5 0.1 0.2])
Use help
patch(A(:,1),A(:,2),'c')
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Elementary Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!