Prev: How can we use same image variable in two different callbacks
Next: need help with exporting figures into jpgs
From: Walter on 3 Sep 2009 09:19 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 3 Sep 2009 09:37 "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 4 Sep 2009 00:29
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 > |