Shade Area Between 2 Tabulated Plots.
显示 更早的评论
Hello,
I have written a script which plots 2 curves from excel data. Could someone please help me as to how I can shade the area between the 2 curves?
This is my Script:
UserDir = 'C:\Users\****\Downloads\Test.xlsx';
SheetNameA = 'Sheet1';
Y_Values = readtable(UserDir,'Sheet',SheetNameA,'Range','A2:A150');
X_Values1 = readtable(UserDir,'Sheet',SheetNameA,'Range','C2:C150');
X_Values2 = readtable(UserDir,'Sheet',SheetNameA,'Range','D2:D150');
Y_data = Y_Values{:,1};
X_Data1 = X_Values1{:,1};
X_Data2 = X_Values2{:,1};
plot(X_Data1,Y_data,'b','Linewidth',1);
hold on
plot(X_Data2,Y_data,'b','Linewidth',1);
hold off
Please see the attached excel sheet (and change the UserDir).
To Clarify I would like something like this:

Thanks Everyone!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

