Patch and fill functions are not shading area between confidence intervals in 2024a
I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated.I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated. I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated. patch, fill, shading MATLAB Answers — New Questions