Colour of plot...not based on z coordinate, but on other variable.
Colour of plot...not based on z coordinate, but on other variable.
(OP)
Hi
I plotted an hyperbolic parabolid surface in Matlab. The colour of the plot is based on the z-coordinate of the surface. But, now I want to visualise the result of an other function (like: f= x+y+2) on the the surface. So the colour of the surface should be based on the result of function f and not on the z-coordinate. Can somebody explain clearly how to do this? Is it a 4dplot?...and/or how this exactly works?
Thanks in advance!
k = 1
x = linspace(-3,3);
y = linspace(-3,3);
[x,y] = meshgrid(x,y);
z = k*x.*y;
mesh(x,y,z)
RE: Colour of plot...not based on z coordinate, but on other variable.
CODE --> MATLAB
Hope that helps. Here's a picture:
Link to picture.
Good luck!
RE: Colour of plot...not based on z coordinate, but on other variable.
Big clue for OP, type help <command name> at the prompt. It is amazing what you'll learn.
Cheers
Greg Locock
New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?