Thread Subject: mesh plot question - "see through" wire frame

Subject: mesh plot question - "see through" wire frame

From: Matt H

Date: 25 Nov, 2009 16:16:20

Message: 1 of 5

1. Is there a command that will make my mesh "see through", so I'm left with only a wire frame?

2. Can I adjust the color of the frame when I get there?

- Thanks!

Subject: mesh plot question - "see through" wire frame

From: Matt Fig

Date: 25 Nov, 2009 16:40:24

Message: 2 of 5

% Make a mesh
[X,Y] = meshgrid(-3:.125:3);
Z = peaks(X,Y);
M = mesh(X,Y,Z);
axis([-3 3 -3 3 -10 5])

% Now set the faces to "see-through"
set(M,'facealpha',0)

% Make a uniform color
set(M,'edgecolor',[.2 .4 .9])

For more general color manipulations, see the colormap and cdata.

Subject: mesh plot question - "see through" wire frame

From: Florian

Date: 25 Nov, 2009 16:44:05

Message: 3 of 5

Like this?

[X,Y] = meshgrid(-3:.25:3);
Z = peaks(X,Y);
plot3(X,Y,Z)
hold on
plot3(X',Y',Z')
grid on
axis([-3 3 -3 3 -10 5])

this should give you that "wireframe look" you are looking for.

Cheers,
Florian

"Matt H" <hoffm426@gmail.com> wrote in message <hejl8j$bfd$1@fred.mathworks.com>...
> 1. Is there a command that will make my mesh "see through", so I'm left with only a wire frame?
>
> 2. Can I adjust the color of the frame when I get there?
>
> - Thanks!

Subject: mesh plot question - "see through" wire frame

From: John D'Errico

Date: 25 Nov, 2009 16:50:17

Message: 4 of 5

"Matt Fig" <spamanon@yahoo.com> wrote in message <hejmlo$a3u$1@fred.mathworks.com>...
> % Make a mesh
> [X,Y] = meshgrid(-3:.125:3);
> Z = peaks(X,Y);
> M = mesh(X,Y,Z);
> axis([-3 3 -3 3 -10 5])
>
> % Now set the faces to "see-through"
> set(M,'facealpha',0)
>
> % Make a uniform color
> set(M,'edgecolor',[.2 .4 .9])
>
> For more general color manipulations, see the colormap and cdata.

I would point out that I have sometimes seen
problems when using transparency. Large plots
with some degree of transparency will occasionally
cause matlab to crash. So I would avoid setting
the faces to be fully transparent for no good
reason. A better solution may be just to set the
faces to have a color of 'none'.

set(M,'facecolor','none')

In addition, it is likely to be faster.

John

Subject: mesh plot question - "see through" wire frame

From: Matt Fig

Date: 25 Nov, 2009 18:08:19

Message: 5 of 5

"John D'Errico" <woodchips@rochester.rr.com> wrote in message
> I would point out that I have sometimes seen
> problems when using transparency. Large plots
> with some degree of transparency will occasionally
> cause matlab to crash. So I would avoid setting
> the faces to be fully transparent for no good
> reason. A better solution may be just to set the
> faces to have a color of 'none'.
>
> set(M,'facecolor','none')
>
> In addition, it is likely to be faster.
>
> John

Good point, John. I haven't seen any crashes from doing what I did, but I believe you are probably correct about the speed.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
wireframe Matt H 25 Nov, 2009 11:19:10
mesh Matt H 25 Nov, 2009 11:19:09
plot Matt H 25 Nov, 2009 11:19:09
surface Matt H 25 Nov, 2009 11:19:07
rssFeed for this Thread

Contact us at files@mathworks.com