Problem with plotting individual CData on triangular mesh

I am having an issue with plotting a triangular surface with individual CData face colors. My CData contains NaN, as well as integer values (non scaled).
Here is the code I am using:
figure;
f1 = patch('Faces',faces,'Vertices',vertices);
set(f1,'FaceColor','flat','FaceVertexCData',CData,'CDataMapping','scaled');
When the figure window opens, I see an uncolored wire mesh of my object.
Interestingly, if I add the following lines:
hold on;
plot3(vertices(:,1), vertices(:,2), vertices(:,3), 'k.')
All of a sudden my colored faces show up, but I don't want the plotted vertices! If I turn them off manually using the property editor, my face colors disappear.
Does anyone know what's going on here? What am I missing?
Thanks, Erin

回答(2 个)

Hi Erin,
just guessing, since I have no MATLAB available right now. It could be the renderer: try
set(gcf, 'renderer', 'zbuffer')
after creating the patch....?
Titus

类别

帮助中心File Exchange 中查找有关 Graphics Performance 的更多信息

产品

标签

提问:

2011-9-1

Community Treasure Hunt

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

Start Hunting!

Translated by