How to plot isosurface of for a wide range of values

조회 수: 13 (최근 30일)
moh mor
moh mor 2024년 4월 28일
댓글: Mathieu NOE 2024년 5월 28일
I wish to plot isosurface of my data, But in a wide range of values. For example, MathWork has introduced the following example for one-value isosurface in its help:
[x,y,z,v] = flow;
p = patch(isosurface(x,y,z,v,-3));
isonormals(x,y,z,v,p)
p.FaceColor = 'red';
p.EdgeColor = 'none';
daspect([1 1 1])
view(3);
axis tight
camlight
lighting gouraud
The above example, will plot "flow" data if their "v" values is equal to -3.
What I want to do, is that I want to plot my data like "flow", which their "v" values are higher than -3, not exactly equal to -3.
  댓글 수: 1
Paul
Paul 2024년 4월 28일
An isosurface is only defined for a one value. Do you want to show separate plots of different isosurfaces for set of distinct values? Or somehow display multiple isosurfaces for different values on one plot? Or ...?

댓글을 달려면 로그인하십시오.

채택된 답변

Mathieu NOE
Mathieu NOE 2024년 4월 29일
as @Paul suggested, we can define several levels and display them on the same plot
just having some fun with colors and transparency to give an idea of the result
[x,y,z,v] = flow;
k = (-4:1:-1);
figure,
hold on
for i = 1:numel(k)
p = patch(isosurface(x,y,z,v,k(i)));
f = i/numel(k); % fraction number
isonormals(x,y,z,v,p)
p.FaceColor = [1 f 1-f];
p.EdgeColor = 'none';
p.FaceAlpha = f;
daspect([1 1 1])
view(3);
axis tight
camlight
lighting gouraud
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by