From: Walter on
Hello,

I have to make a plot depending on 2 angles and a radius. so long there is no problem. Is ist possible to make the color of the plot according to the radius and not to the z-axis lie it is usually?

my code:

Code:

clear all;
load data2;
phi=data2(:,2);
theta=data2(:,1);
radius=data2(:,3);
[hor vert]=meshgrid(0:360,0:360);
r=griddata(theta,phi,radius,hor,vert);
[x y z]=sph2cart(hor*pi/180,vert*pi/180,r);
surf(x,y,z);
colorbar;
axis auto
hold on


thanks for all answers!

greez

walter

From: Steven Lord on

"Walter " <w.mueller(a)zimmer.de> wrote in message
news:h7ofo6$5sg$1(a)fred.mathworks.com...
> Hello,
>
> I have to make a plot depending on 2 angles and a radius. so long there is
> no problem. Is ist possible to make the color of the plot according to the
> radius and not to the z-axis lie it is usually?

Take a look at the first two paragraphs in the M-file help for the SURF
function, then try:


surf(x, y, z, x) % using the x, y, and z variables from your original code


Then generalize.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Walter on
works, thanks!

"Steven Lord" <slord(a)mathworks.com> wrote in message <h7ogqa$h2s$1(a)fred.mathworks.com>...
>
> "Walter " <w.mueller(a)zimmer.de> wrote in message
> news:h7ofo6$5sg$1(a)fred.mathworks.com...
> > Hello,
> >
> > I have to make a plot depending on 2 angles and a radius. so long there is
> > no problem. Is ist possible to make the color of the plot according to the
> > radius and not to the z-axis lie it is usually?
>
> Take a look at the first two paragraphs in the M-file help for the SURF
> function, then try:
>
>
> surf(x, y, z, x) % using the x, y, and z variables from your original code
>
>
> Then generalize.
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>