Plot two overlapping surfaces on the same image
10 views (last 30 days)
Show older comments
Hi All,
I am trying to plot two surfaces, one being a transparent interpolated surface of a heart and the second being a solid subset of that surface representing a voxel of interest. For some reason I cannot get the voxel surface to show up the way I want it to. My code and relevant files are attached. I appreciate any assistance with this. Thank you so much!
5 Comments
Accepted Answer
Voss
on 20 Jul 2023
Does this seem right?
isochronal_crowding
delete([1 2]) % remove first two figures for clarity
You'll see the following in the code (lines 655-656):
p = trisurf(K,x_points',y_points',z_points',colorCategory,'FaceAlpha',1,'EdgeColor','none');
p.FaceVertexCData(~ismember(x_points,x_v)) = NaN;
That creates a second (solid) trisurf patch using all the points (same points used in the first (transparent) trisurf patch), but then the faces that are not in the low-voltage data (x_v, y_v, z_v) are set to NaN so they don't show up and only the transparent surface is seen in those regions.
4 Comments
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!