Ploting (x,z) and (y,z) data on same plot

3 vues (au cours des 30 derniers jours)
Kabit Kishore
Kabit Kishore le 18 Fév 2022
Commenté : Kabit Kishore le 22 Fév 2022
Hi i have multiple (x,z) and (y,z) grid data. I want to plot them on the same axis in 3D. The x and y meaurements are separated by 1 meters apart as shown in the picture attached. I am also attaching my data. Any leads for this will be appreciated. Thank you.
  1 commentaire
Kabit Kishore
Kabit Kishore le 18 Fév 2022
I have managed to plot line x0 and y0. However i want to plot the rest of line on this same plot which are separated by 1 meters interval in both x and y directions. This is what i have done.
scatter3(x,zeros(size(x)),z)
hold on
scatter3(zeros(size(y)),y,z1)

Connectez-vous pour commenter.

Réponse acceptée

Kevin Holly
Kevin Holly le 18 Fév 2022
Modifié(e) : Kevin Holly le 18 Fév 2022
I'm not sure what you mean by the x and y measurements being separated by 1 meter. Below is a guess at want you want. Please clarifiy.
x0 = readtable('x0.xlsx');
x1 = readtable('x1.xlsx');
y0 = readtable('y0.xlsx');
y1 = readtable('y1.xlsx');
plot3(x0.x,zeros(length(x0.x)),x0.z)
hold on
plot3(x1.x,ones(length(x1.x)),x1.z)
plot3(zeros(length(y0.y)),y0.y,y0.z)
plot3(ones(length(y1.y)),y1.y,y1.z)
xlabel('x')
ylabel('y')
zlabel('z')
  3 commentaires
Kevin Holly
Kevin Holly le 22 Fév 2022
x0 = readtable('x0.xlsx');
x1 = readtable('x1.xlsx');
y0 = readtable('y0.xlsx');
y1 = readtable('y1.xlsx');
Colorimage = zeros(max(length(y0.y),length(y1.y)),max(length(x0.x),length(x1.x)));
Colorimage(length(y0.z)-1,:)=x0.z;% made it one off so it displays color
Colorimage(length(y0.z)-100,1:length(x1.x))=x1.z;
Colorimage(:,length(x0.z)-1)=y0.z;% made it one off so it displays color
Colorimage(1:length(y1.y),length(x0.z)-100)=y1.z;
surf(Colorimage)
h=gca;
h.Children.EdgeColor ='none';
h.Children.XData = x0.x;
h.Children.YData = y0.y;
xlabel('x')
ylabel('y')
zlabel('z')
colorbar
figure(2)
Colorimage = zeros(max(length(y0.y),length(y1.y)),max(length(x0.x),length(x1.x)));
Colorimage(length(y0.z)-23,:)=x0.z;% shifted to make visible
Colorimage(length(y0.z)-100,1:length(x1.x))=x1.z;
Colorimage(:,length(x0.z))=y0.z;
Colorimage(1:length(y1.y),length(x0.z)-100)=y1.z;
imagesc(fliplr(Colorimage))
xlabel('x')
ylabel('y')
colorbar
axis off
Kabit Kishore
Kabit Kishore le 22 Fév 2022
Thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Discrete Data Plots dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by