Plotting level sets of a function on a triangulated surface.
古いコメントを表示
I want to plot the level sets of one function g(x,y,z) as curves on an isosurface f(x,y,z)=c. The following code comes close, but I need help getting over the finish line.
[x,y,z] = meshgrid(-1:.025:1);
f = x.^2 +y.^2 + z.^2;
g = x.^2 - y.^2;
c = 0.8
[faces,verts,colors] = isosurface(x,y,z,f,c,g);
patch('Vertices',verts,'Faces',faces,'FaceVertexCData',colors,...
'FaceColor','interp','EdgeColor','none')
view(3)
axis equal
colormap(turbo(10))

In this example code, we can see the level sets as the boundaries between the colored regions, but what I really want is
- Curves on a solid-colored sphere
- The ability to choose which values of g(x,y,z) get plotted
- The ability to choose line styles, colors, and thicknesses
1 件のコメント
Roy Goodman
2025 年 7 月 3 日
編集済み: Roy Goodman
2026 年 1 月 13 日
採用された回答
その他の回答 (1 件)
カテゴリ
ヘルプ センター および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


