带有置信边界的线图
使用 fill
函数绘制置信边界,同时使用 plot
函数绘制数据点,以此方式创建含有置信边界的绘图。使用圆点表示法语法 object.PropertyName
自定义绘图的外观。
x = 0:0.2:10; y = besselj(0, x); xconf = [x x(end:-1:1)] ; yconf = [y+0.15 y(end:-1:1)-0.15]; figure p = fill(xconf,yconf,'red'); p.FaceColor = [1 0.8 0.8]; p.EdgeColor = 'none'; hold on plot(x,y,'ro') hold off