Plots a surface coloring by layers (using contour curves)

버전 1.0.0.0 (2.12 KB) 작성자: Rafael Palacios
Creates a surface and applies color by layers. Different elevation levels are clearly identified.
다운로드 수: 1K
업데이트 날짜: 2010/4/13

라이선스 보기

Different elevations cannot be identified with standard matlab functions such as surf, even changing FaceColor attribute to activate interpolation. In contrast, with this function alows one can define contour levels and different colors are applied to each level.

Instead of using surf(x,y,z), you use surflayers(x,y,z,[5 10 15 20]);
The quality of the results may depende on the layer falues that you select. Sometimes surflayers is not very accurate, but in general produces very good results.

% [s m]=surflayers2(X,Y,Z,layers)
% Plots a surface coloring by layers (using contour curves).
% This function creates a surface using different colors for contours
% values defined in arguments layers, and a transparent mesh with black
% lines on top.
%
% Input Arguments
% X,Y: Vectors or matrices with oordinates of the grid (if unknow see
% Example2 below)
% Z: Matrix of elevations
% layers: vector of contour values
%
% Optional Outputs
% s: handler of the colored surface
% m: handler of the mesh
% (This handlers allow to chage image properties using set(s, ...) call)
%
% Example1:
% [x,y,z]=peaks;
% [s m]=surflayers(x,y,z,[-6.25 -3 -1.5 0 1.75 3.5 6 8]);
%
% Example2:
% L=membrane(1,10);
% x=1:size(L,1);
% y=1:size(L,2);
% [s m]=surflayers(x,y,L,[-0.15, 0, 0.25 .5 .75 .98]);
%
% Author: Rafael Palacios,
% Universidad Pontificia Comillas, Massachusetts Institute of Technology
% http://www.iit.upcomillas.es/palacios
% Version 1, April 2010
%

인용 양식

Rafael Palacios (2024). Plots a surface coloring by layers (using contour curves) (https://www.mathworks.com/matlabcentral/fileexchange/27242-plots-a-surface-coloring-by-layers-using-contour-curves), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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