From: Matt on
Hi,
I am trying to display a contour plot using the trimesh function, but I have some nans in my contour vector. As expected, trimesh won't display the nan's but it makes the mesh elements with the nan vertex transparent.

Here's example:
x=[0 0 1 1 1];
y=[0 1 1 0 0];
z=[0 0 0 0 -1];
tri=[1 2 3; 1 3 4; 1 4 5];
cont=[5 10 15 nan 25];
figure, hs=trisurf(tri,x,y,z,cont);
shading interp;
set(hs,'EdgeColor',[0 0 0]);
axis off; axis vis3d; axis image;
% Set up camera toolbar to spin object
cameratoolbar; cameratoolbar('SetMode','orbit'); cameratoolbar('SetCoordSys','none');

Is it possible to make the faces with verticies that has a nan entry opaque? (With a specific color?)

I tried trisurf(tri,x,y,z,cont,'FaceColor','w'), but it seems that FaceColor superceedes the contour.

Thanks for your help,

Matt
From: Matt on
Nobody has any ideas?
From: John D'Errico on
"Matt" <mfk16(a)removethis-yahoo.com> wrote in message <ht6fp8$3bi$1(a)fred.mathworks.com>...
> Hi,
> I am trying to display a contour plot using the trimesh function, but I have some nans in my contour vector. As expected, trimesh won't display the nan's but it makes the mesh elements with the nan vertex transparent.
>
> Here's example:
> x=[0 0 1 1 1];
> y=[0 1 1 0 0];
> z=[0 0 0 0 -1];
> tri=[1 2 3; 1 3 4; 1 4 5];
> cont=[5 10 15 nan 25];
> figure, hs=trisurf(tri,x,y,z,cont);
> shading interp;
> set(hs,'EdgeColor',[0 0 0]);
> axis off; axis vis3d; axis image;
> % Set up camera toolbar to spin object
> cameratoolbar; cameratoolbar('SetMode','orbit'); cameratoolbar('SetCoordSys','none');
>
> Is it possible to make the faces with verticies that has a nan entry opaque? (With a specific color?)
>
> I tried trisurf(tri,x,y,z,cont,'FaceColor','w'), but it seems that FaceColor superceedes the contour.
>
> Thanks for your help,
>
> Matt

You could do this with two calls. But you will need
to extract the triangles that touch a nan. Plot them
separately using a fixed, specified color of your choice.

John
From: Matt on
"John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <htdsrq$geg$1(a)fred.mathworks.com>...
> "Matt" <mfk16(a)removethis-yahoo.com> wrote in message <ht6fp8$3bi$1(a)fred.mathworks.com>...
> > Hi,
> > I am trying to display a contour plot using the trimesh function, but I have some nans in my contour vector. As expected, trimesh won't display the nan's but it makes the mesh elements with the nan vertex transparent.
> >
> > Here's example:
> > x=[0 0 1 1 1];
> > y=[0 1 1 0 0];
> > z=[0 0 0 0 -1];
> > tri=[1 2 3; 1 3 4; 1 4 5];
> > cont=[5 10 15 nan 25];
> > figure, hs=trisurf(tri,x,y,z,cont);
> > shading interp;
> > set(hs,'EdgeColor',[0 0 0]);
> > axis off; axis vis3d; axis image;
> > % Set up camera toolbar to spin object
> > cameratoolbar; cameratoolbar('SetMode','orbit'); cameratoolbar('SetCoordSys','none');
> >
> > Is it possible to make the faces with verticies that has a nan entry opaque? (With a specific color?)
> >
> > I tried trisurf(tri,x,y,z,cont,'FaceColor','w'), but it seems that FaceColor superceedes the contour.
> >
> > Thanks for your help,
> >
> > Matt
>
> You could do this with two calls. But you will need
> to extract the triangles that touch a nan. Plot them
> separately using a fixed, specified color of your choice.
>
> John

Thanks for the suggestion, I'll try it out.

-Matt
 | 
Pages: 1
Prev: Xls write cell array
Next: Joint Hypothesis