Filling area between two planes in 3d plot
显示 更早的评论
I'm trying to more or less plot an amorphous blob on a 3d plot. I know the top, and I know the bottom. Is there an easy way to fill the space between? For example, if I have
surf(peaks)
hold on
surf(peaks + 5)
hold off
How could I connect the two planes so it's like a volume?
Thank you so much for your time
采纳的回答
更多回答(1 个)
Tim Jackman
2015-9-3
One option would be to create an isosurface, but to do that you would need to convert your data into a 3-D gridded data. This link has some more information and a couple examples to follow:
Based on the example you provided, and quick way to fill the space in between the two surfaces would be to apply a patch. For example:
surf(peaks)
hold on
surf(peaks + 5)
hold off
Now place a polygon along one edge by supplying the X, Y, and Z coordinates along with the color you want:
patch([1;1;49;49],[1;1;1;1],[0;5;5;0],[1,0,0])
You can get more information on the patch objects here:
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

