Log-log plot with error band that has negative numbers
Show older comments
How do I make an error band? I am attaching some sample data. The fill function generates negative numbers, so that when I try either this:
figure;
loglog(x,y)
fill([x; flipud(x)],[y-std_y;flipud(y+std_y)],'k','FaceAlpha',0.5);
or this:
figure;
plot(x,y)
fill([x; flipud(x)],[y-std_y;flipud(y+std_y)],'k','FaceAlpha',0.5);
set(gca, 'XScale','log', 'YScale','log')
The error band doesn't show up.
Accepted Answer
More Answers (0)
Categories
Find more on Annotations 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!