Thread Subject: plot3 with color according to z-value?

Subject: plot3 with color according to z-value?

From: jdellanna@web.de

Date: 5 Nov, 2008 10:22:54

Message: 1 of 5

Hi there!
I want to plot a pack of data with structure [x(i) y(i) z(i)] in a way
that the color changes specified by the z-values. I tried already
plot3, surf, surface, mesh and scatter3. With plot3 the data are
displayed in the way I want, but not with changing color. And with
surf, surface, mesh and scatter3 I get changing color, but the x- and
y- axis values are no more according to the x(i) and y(i) coordinate
values but seem to be the index i, so that the projection of the
surface I define with all those xyz-pairs to the x-y-plane is no more
shaped like a rhomb with the correct x,y-values, but a full square
with the number of data pairs as x- and y-values. The optimum for me
would be if I could just change the color in plot3 from single-color
to z-value-dependent. Is that possible? What can I do?
Thanx for your support :-)
Jazz

Subject: plot3 with color according to z-value?

From: Wolfgang Schwanghart

Date: 5 Nov, 2008 10:35:03

Message: 2 of 5

This might be what you are searching for:
http://www.mathworks.com/matlabcentral/fileexchange/14677

Best regards,
Wolfgang


jdellanna@web.de wrote in message <db855997-a73b-4230-83a8-e6a152e8d56e@q30g2000prq.googlegroups.com>...
> Hi there!
> I want to plot a pack of data with structure [x(i) y(i) z(i)] in a way
> that the color changes specified by the z-values. I tried already
> plot3, surf, surface, mesh and scatter3. With plot3 the data are
> displayed in the way I want, but not with changing color. And with
> surf, surface, mesh and scatter3 I get changing color, but the x- and
> y- axis values are no more according to the x(i) and y(i) coordinate
> values but seem to be the index i, so that the projection of the
> surface I define with all those xyz-pairs to the x-y-plane is no more
> shaped like a rhomb with the correct x,y-values, but a full square
> with the number of data pairs as x- and y-values. The optimum for me
> would be if I could just change the color in plot3 from single-color
> to z-value-dependent. Is that possible? What can I do?
> Thanx for your support :-)
> Jazz

Subject: plot3 with color according to z-value?

From: Jasmin DellAnna

Date: 5 Nov, 2008 13:37:01

Message: 3 of 5

Thanx alot!! That's exactly what I was looking for :-)
Best regards,
Jazz

"Wolfgang Schwanghart" <schwanghartremove.this@googlemail.com> wrote in message <gerssn$3eh$1@fred.mathworks.com>...
> This might be what you are searching for:
> http://www.mathworks.com/matlabcentral/fileexchange/14677
>
> Best regards,
> Wolfgang
>
>
> jdellanna@web.de wrote in message <db855997-a73b-4230-83a8-e6a152e8d56e@q30g2000prq.googlegroups.com>...
> > Hi there!
> > I want to plot a pack of data with structure [x(i) y(i) z(i)] in a way
> > that the color changes specified by the z-values. I tried already
> > plot3, surf, surface, mesh and scatter3. With plot3 the data are
> > displayed in the way I want, but not with changing color. And with
> > surf, surface, mesh and scatter3 I get changing color, but the x- and
> > y- axis values are no more according to the x(i) and y(i) coordinate
> > values but seem to be the index i, so that the projection of the
> > surface I define with all those xyz-pairs to the x-y-plane is no more
> > shaped like a rhomb with the correct x,y-values, but a full square
> > with the number of data pairs as x- and y-values. The optimum for me
> > would be if I could just change the color in plot3 from single-color
> > to z-value-dependent. Is that possible? What can I do?
> > Thanx for your support :-)
> > Jazz

Subject: plot3 with color according to z-value?

From: russell.fung@gmail.com

Date: 5 Nov, 2008 14:45:46

Message: 4 of 5

On Nov 5, 4:35=A0am, "Wolfgang Schwanghart"
<schwanghartremove.t...@googlemail.com> wrote:
> This might be what you are searching for:http://www.mathworks.com/matlabc=
entral/fileexchange/14677
>
> Best regards,
> Wolfgang
>
> jdella...@web.de wrote in message <db855997-a73b-4230-83a8-e6a152e8d...@q=
30g2000prq.googlegroups.com>...
> > Hi there!
> > I want to plot a pack of data with structure [x(i) y(i) z(i)] in a way
> > that the color changes specified by the z-values. I tried already
> > plot3, surf, surface, mesh and scatter3. With plot3 the data are
> > displayed in the way I want, but not with changing color. And with
> > surf, surface, mesh and scatter3 I get changing color, but the x- and
> > y- axis values are no more according to the x(i) and y(i) coordinate
> > values but seem to be the index i, so that the projection of the
> > surface I define with all those xyz-pairs to the x-y-plane is no more
> > shaped like a rhomb with the correct x,y-values, but a full square
> > with the number of data pairs as x- and y-values. The optimum for me
> > would be if I could just change the color in plot3 from single-color
> > to z-value-dependent. Is that possible? What can I do?
> > Thanx for your support :-)
> > Jazz

You can use the mesh command with three inputs X, Y, Z.

X and Y here can be generated from your x(i), y(i) values using
meshgrid.

Subject: plot3 with color according to z-value?

From: Ken Garrard

Date: 6 Nov, 2008 20:03:03

Message: 5 of 5

Try plot3k from the FEX,
http://www.mathworks.com/matlabcentral/fileexchange/9519
Ken

jdellanna@web.de wrote in message <db855997-a73b-4230-83a8-e6a152e8d56e@q30g2000prq.googlegroups.com>...
> Hi there!
> I want to plot a pack of data with structure [x(i) y(i) z(i)] in a way
> that the color changes specified by the z-values. I tried already
> plot3, surf, surface, mesh and scatter3. With plot3 the data are
> displayed in the way I want, but not with changing color. And with
> surf, surface, mesh and scatter3 I get changing color, but the x- and
> y- axis values are no more according to the x(i) and y(i) coordinate
> values but seem to be the index i, so that the projection of the
> surface I define with all those xyz-pairs to the x-y-plane is no more
> shaped like a rhomb with the correct x,y-values, but a full square
> with the number of data pairs as x- and y-values. The optimum for me
> would be if I could just change the color in plot3 from single-color
> to z-value-dependent. Is that possible? What can I do?
> Thanx for your support :-)
> Jazz

Tags for this Thread

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.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com