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

15 ビュー (過去 30 日間)
Kabit Kishore
Kabit Kishore 2022 年 2 月 18 日
コメント済み: Kabit Kishore 2022 年 2 月 22 日
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 件のコメント
Kabit Kishore
Kabit Kishore 2022 年 2 月 18 日
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)

サインインしてコメントする。

採用された回答

Kevin Holly
Kevin Holly 2022 年 2 月 18 日
編集済み: Kevin Holly 2022 年 2 月 18 日
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 件のコメント
Kevin Holly
Kevin Holly 2022 年 2 月 22 日
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 2022 年 2 月 22 日
Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by