can someone please tell me how to colour the mark area A,B,C,D?

1 view (last 30 days)
can someone please tell me how to colour the colour the mark area A,B,C,D?
x1=[0.8043 0];
y1=[0 0.0789];
plot(x1,y1,'k')
hold on
x2=[0.8407 0];
y2=[0 0.0825];
plot(x2,y2,'b')
hold on
x3=[0.8726 0];
y3=[0 0.0890];
plot(x3,y3,'g')
hold on
x4=[0.1 0.2];
y4=[0 0.1];
plot(x4,y4,'r')
xlim([0,0.9])
ylim([0,0.1])
xticks([0 0.9 ])
xticklabels({'0','0.9'})
yticks([0 0.1 ])
yticklabels({'0','0.1'})
xlabel('PVB content in binder')
ylabel('SA content in binder')

Answers (1)

DGM
DGM on 1 Dec 2021
Something like this:
x1=[0.8043 0];
y1=[0 0.0789];
x2=[0.8407 0];
y2=[0 0.0825];
x3=[0.8726 0];
y3=[0 0.0890];
x4=[0.1 0.2];
y4=[0 0.1];
% find intersections
m1 = (y1(2)-y1(1))/(x1(2)-x1(1));
m2 = (y2(2)-y2(1))/(x2(2)-x2(1));
m4 = (y4(2)-y4(1))/(x4(2)-x4(1));
xint14 = ((m1*x1(1)-m4*x4(1))-(y1(1)-y4(1)))/(m1-m4);
yint14 = m1*(xint14-x1(1))+y1(1);
xint24 = ((m2*x2(1)-m4*x4(1))-(y2(1)-y4(1)))/(m2-m4);
yint24 = m2*(xint24-x2(1))+y2(1);
hp = patch([xint14 xint24 x2(1) x1(1) xint14],[yint14 yint24 y2(1) y1(1) yint14],'k');
hp.FaceAlpha = 0.2;
hold on
plot(x1,y1,'k')
plot(x2,y2,'b')
plot(x3,y3,'g')
plot(x4,y4,'r')
xlim([0,0.9])
ylim([0,0.1])
xticks(xlim)
yticks(ylim)
xlabel('PVB content in binder')
ylabel('SA content in binder')

Categories

Find more on MATLAB in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!