MATLAB: How to remove the edge lines on patches in a tetramesh plot in any release of MATLAB

dwhhgMATLAB

When I create a tetramesh plot, a series of patches are created but contain edges that I would like to remove.
For example:
d = [-1 1];
[x,y,z] = meshgrid(d,d,d); % A cube
x = [x(:);0];
y = [y(:);0];
z = [z(:);0];
% [x,y,z] are corners of a cube plus the center.
X = [x(:) y(:) z(:)];
Tes = delaunayn(X);
tetramesh(Tes,X)
contains edges around the patch objects.
I want to remove the patch edges programmatically.

Best Answer

The lines that appear can be controlled via a property of Patch objects called LineStyle.
One way to do this would be to find all the patch objects and then use the SET command to change the 'LineStyle' to 'none'.
In this particular case, however, the function TETRAMESH allows you to specify this property at creation of the plot.
For example:
d = [-1 1];
[x,y,z] = meshgrid(d,d,d); % A cube
x = [x(:);0];
y = [y(:);0];
z = [z(:);0];
% [x,y,z] are corners of a cube plus the center.
X = [x(:) y(:) z(:)];
Tes = delaunayn(X);
tetramesh(Tes,X,'LineStyle','none')
Related Question