Ploting (x,z) and (y,z) data on same plot
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kabit Kishore
el 18 de Feb. de 2022
Comentada: Kabit Kishore
el 22 de Feb. de 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.
Respuesta aceptada
Kevin Holly
el 18 de Feb. de 2022
Editada: Kevin Holly
el 18 de Feb. de 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 comentarios
Kevin Holly
el 22 de Feb. de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre Discrete Data Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



