Hello,
I am struggling with shading area under the curve at the selected area. I wanted to fill the area over Body Weight line. I have attached my code and the screenshot of the plot.
x = 0:2500;Lvy = (611 <= x)&(vgrf2 >= bw) & (x < 794);figure(1)plot(x,vgrf2,'k')hold on;xline(lcom,'k--','Lowest COM position','LabelHorizontalAlignment','center',... 'LabelOrientation','horizontal');yline(bw,'k--',{'Body','Weight'},'LabelHorizontalAlignment','left',... 'LabelVerticalAlignment','middle');patch([x(Lvy) fliplr(x(Lvy))], [ones(size(x(Lvy))) fliplr(vgrf2(Lvy))], 'g')hold off;
Best Answer