I am using the ecdf command to plot empirical cdfs with their associated confidence intervals. I want to fill in/shade the confidence interval area.
This is the code i have used for the confidence intervals:
data1 = xlsread('File1.xlsx');
[F,X,Flo1,Fup1] = ecdf(data1);
plot(X,F,'LineWidth',2); hold on;
and this is the code using shadedplot:
ha=shadedplot(X,Flo1',Fup1', [0.2 0.7 0.7], 'g');
I could not get it to work however. It still gives me the confidence intervals but they are not shaded in. Any help will be greatly appreciated (I'm a beginner in Matlab!)
No products are associated with this question.
Do you know if the shadedplot() command you are using is this one from the File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/18738-shaded-area-plot?
It is a little difficult to help you debug this, because we don't have your data (and we don't have your function unless we download it).
I can suggest a few things, though. It looks like shadedplot() is supposed to plot the lines as well as the shaded area. But you are also plotting the lines with separate plot commands. Do you get the lines from shadedplot if you do not do the other plot commands?
You could try to see if you can post a small sample of your data that still exhibits the problem. Then, we can at least to replicate the problem (if people are willing to download the FEX code). This simplification may actually also help you see what is causing the problem.
Another thing I would suggest is using debug mode to step into the code and see if you can tell why the shading isn't working. There are detailed instructions on how to do that here: http://www.mathworks.com/help/matlab/debugging-code.html. (This is something that is good for any beginner to learn!)