I have this (X,Y) dataset and I want to plot with the std.error marked as shading. However, I have have problem when the std is 0. Here is a simple code is use for testing:
x = Data(:,1);
y = Data(:,2);
dy = 0.3*y;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],[.2 .9 .9],'linestyle','none');
line(x,y);
alpha(0.1);
The dy is my std. error which is working fine, but when I change this to 0 it is looks strange (it should be equal the line)
Here is my dataset:
Data = [
260.0000 0
259.5000 -0.0166
259.0000 -0.0487
258.5000 -0.0445
258.0000 -0.0437
257.5000 -0.0638
257.0000 -0.0583
256.5000 -0.0880
256.0000 -0.0961
255.5000 -0.0706
255.0000 -0.0863
254.5000 -0.1051
254.0000 -0.1140
253.5000 -0.1329
253.0000 -0.1307
252.5000 -0.1433
252.0000 -0.1625
251.5000 -0.1366
251.0000 -0.1359
250.5000 -0.1413
250.0000 -0.1438
249.5000 -0.1538
249.0000 -0.1352
248.5000 -0.1844
248.0000 -0.2098
247.5000 -0.2066
247.0000 -0.2031
246.5000 -0.2036
246.0000 -0.2479
245.5000 -0.2791
245.0000 -0.3187
244.5000 -0.3629
244.0000 -0.4218
243.5000 -0.5147
200.0000 2.5618
199.5000 3.9747
199.0000 5.4836
198.5000 7.0462
198.0000 8.4347
197.5000 9.7647
197.0000 11.1262
196.5000 12.2604
196.0000 13.3529
195.5000 14.4072
195.0000 15.3222
194.5000 16.1851
194.0000 16.9095
193.5000 17.4813
193.0000 17.8846
192.5000 18.1166
192.0000 18.3644
191.5000 18.5597
191.0000 18.5822
190.5000 18.5643
190.0000 18.3095
189.5000 17.9620
189.0000 17.6198
188.5000 17.1708
188.0000 16.8142
187.5000 16.4826
187.0000 16.1231
186.5000 15.1229
186.0000 14.6209
185.5000 13.4553
185.0000 12.5914
184.5000 10.4794
184.0000 8.5036
183.5000 6.4980
183.0000 4.7882
182.5000 3.7990
182.0000 3.4504
181.5000 0.5280
181.0000 -0.9536
180.5000 -3.2450
180.0000 -4.9457]