how to make a 3d plot with x,y,z, coordinates and data (t)
Show older comments
Hi, I have x,y,z,t data in a excel file. The x,y,z are coordinates while t is data. How can i plot a 3d plot. the x,y,z are usually in a plane so z is constant. x and y are equispaced and sometimes may not be. how to plot. expecting earliest attention thanks rama
5 Comments
Walter Roberson
on 15 Mar 2013
How do you want to represent your "t" ? As dot size? As color? Ignore the z and treat "t" as if it were z ?
rama krishna
on 15 Mar 2013
Walter Roberson
on 15 Mar 2013
To get a surface or mesh you need to know something about the connectivity of the points.
Consider for example a simple list of 5 points around a circle: connect them in clockwise order and you get a pentagon shape, but connect each to the second closest instead and you get a "star" (pentagram). Likewise if you do not know which of your points connect to which, you cannot know how to build your surface.
Walter Roberson
on 15 Mar 2013
How do you know which points are adjacent?
rama krishna
on 15 Mar 2013
Answers (2)
Youssef Khmou
on 15 Mar 2013
hi,
try
plot3(x,y,t);
scatter3(x,y,t,'r');
% z is constant !
Youssef Khmou
on 16 Mar 2013
hi ,
as you want to visualize t ( t as function of x and y t=F(x,y)) then i suggest this trick , i show it based on an example ok? :
1)EXAMPLE 1 :
x=0:0.1:10;
y=0:0.1:10;
t=randn(size(x));
% I ADJUST the lengths so as to map the vectors x and y into matrices
X=reshape(x(1:100),10,10);
Y=reshape(y(1:100),10,10);
T=reshape(t(1:100),10,10);
% FIGURE
surf(X,Y,T);shading interp
2)EXAMPLE2 :
x=randn(10); % Gaussian Process N(0,1)
y=randn(10); % same ~N(0,1)
t=rand(10); % Random Uniform distribution
surf(x,y,t);shading interp
i hope this helps , try to apply on your data and see......
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!