errorfill

버전 1.0.0.0 (3.26 KB) 작성자: Peder Axensten
Use this function to draw a curve and its areas of confidence.
다운로드 수: 3.9K
업데이트 날짜: 2006/4/26

라이선스 보기

Usage: figurehandle= errorfill(x, y, E1, E2, ..., LineSpec)

Use this function to draw a curve and its areas of confidence. Draws the line y(x), then draws the areas E1(x), E2(x), ... (Well actually it's done in the opposite order, to minimize overlap.)

x:
The x values for y, E1, E2, ...
If x is a scalar, then (x, x+1, x+2, ...) is used.
If x is empty, then (1, 2, ...) is used.
Values must be finite and not NaN.

y:
Defines the curve, y(x).
Values must be finite and not NaN.

E:
The 'error' of y. Defines the area.
If E is a scalar, the shade will be between y(n)*(1+E) and y(n)*(1-E).
If E is of size (1,2) or (2,1), it will be between y(n)*(1+E(1)) and y(n)*(1-E(2)).
If E is a vector, the shade will be between y(n)+E(n) and y(n)-E(n).
If E is a double vector, the shade will be between y(n)+E(1,n) and y(n)-E(2,n).
Inf is marked by a jump up to a '^' symbol.
-Inf is marked by a jump down to a 'v' symbol.
NaN is marked by a jump up or down to a '*' symbol.

LineSpec:
(Default: 'k') Line specification for y(x), e.g. 'b+'.

NOTE:
The E:s must be given in increasing size, or an area will be covered by a previous and larger area.

COMPATIBILITY:
errorbar(x, y, E, LineSpec) corresponds to errorfill(x, y, E, LineSpec).
errorbar(x, y, L, U, LineSpec) corresponds to errorfill(x, y, [U; L], LineSpec).

EXAMPLE:
x= (1:0.25:10);
y= x.^2;
E3= [ones(1, length(x))*30; 0.7*y]; % 30 above and 0.3*y below
E3(1,7)= Inf;
E3(2,10)= Inf;
E3(2,25)= NaN;
errorfill(x, y, [0.1 0.02], 0.3, E3, 'b-+');
legend('E3', 'E2', 'E1', 'x^2','Inf','-Inf','NaN');

TO DO:
Make it work for y-values of Inf, -Inf, and NaN.

인용 양식

Peder Axensten (2024). errorfill (https://www.mathworks.com/matlabcentral/fileexchange/10843-errorfill), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R14SP1
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Line Plots에 대해 자세히 알아보기
도움

도움 받은 파일: confplot, JackKnife

도움 준 파일: errorshade, boundedline.m

Community Treasure Hunt

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

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