Plotting Uncertainty (Bounded Line)

버전 1.0.4 (3.47 KB) 작성자: Darin Koblick
Display the upper and lower uncertainty bounds about X and Y datasets in a highly customizable style
다운로드 수: 184
업데이트 날짜: 2022/8/17

라이선스 보기

Description
Plot the 2-D uncertainty bounds (upper and lower) about a standard 2-D line plot of x and y data. The bounds are assumed to be +/- of the specified uncertainty value about the y data. This routine features a variable number of user input properties allowing the user to specify customized settings for both the built-in plot and patch routines.
Syntax
plotUnc(x,y,u,l)
plotUnc(x,y,u,l,ColorSpec)
plotUnc(y,u,l)
plotUnc(y,u,l,ColorSpec)
plotUnc(__,Name,Value)
plotUnc(ax, __)
h = plotUnc(__)
Examples
Create an Uncertainty Plot
Create x as a vector of linearly spaced values between 0 and 2π. Use an increment of π/100 between the values. Create y values equal to the sine of x and display a bounded region of ±0.5 about y as defined by the upper and lower bounds (ub and lb).
x = 0:pi/100:2*pi;
y = sin(x);
ub = ones(size(x))./2;
lb = ones(size(x))./2;
plotUnc(x,y,ub,lb);
Plot Uncertainty Without Shading
In some instances, it may be desirable to display bounds about a 2-D dataset without shading. Using the previous example, this can be customized by adding input arguments for the patch routine
plotUnc(x,y,ub,lb,'FaceColor','none');
Plot Multiple Uncertainties
Create x as a vector of 100 linearly spaced values between -2π and 2π. The underlying y data sets are defined as sine and cosine values of x. Plot the uncertainties about both data sets and set their transparency.
x = linspace(-2*pi,2*pi,100)';
y1 = sin(x);
y2 = cos(x);
ub = ones(size(y1))./2;
lb = ones(size(y1))./2;
plotUnc([x,x],[y1,y2],[ub,ub],[lb,lb],'EdgeColor','none','FaceAlpha',0.2);
legend('sin(x)','cos(x)');

인용 양식

Darin Koblick (2024). Plotting Uncertainty (Bounded Line) (https://www.mathworks.com/matlabcentral/fileexchange/116385-plotting-uncertainty-bounded-line), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.4

added more content

1.0.3

added additional content

1.0.2

Adjusted pictures in description

1.0.1

Added more content in the description

1.0.0