Shade Area Between 2 Tabulated Plots.
Show older comments
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!
Accepted Answer
More Answers (0)
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
