3D volume plot

2 views (last 30 days)
Anshul Jain
Anshul Jain on 24 Dec 2022
Respected sir,
I have two entities A and B with their respective 200 (x,y,z) coordinates. (Plz see attached excel sheet).
Entity A is bigger than entity B in volume.
I already have a 3D volume plot of B inside A as an isometric view with respective X, Y and Z axes (Transparent plot using syntax "alpha(0.25)'')
But I want Top-view(shown in the X,Y axes) of the same in the same plot of isometric view (means isometric view and top view in the same plot).
Kindly help me in this regard.
I have used one code for the same as given below but it is not working properly for the Top view. For isometric view it is working fine.
T1 = readtable('Book1.xlsx', 'Sheet',1, 'Range','G1:I201');
T1 = table2array(T1);
T2 = readtable('ForPlot.xlsx', 'Sheet',1, 'Range','L1:N201');
T2 = table2array(T2);
x1=T1(:,1);
y1=T1(:,2);
z1=T1(:,3);
x2=T2(:,1);
y2=T2(:,2);
z2=T2(:,3);
kkk=boundary(x1,y1,z1);
V1=trisurf(kkk,x1,y1,z1,'Facecolor','r','Edgecolor','none');
hold on
kkk=boundary(x2,y2,z2);
V2=trisurf(kkk,x2,y2,z2,'Facecolor','y','Edgecolor','none');
alpha(0.25);
legend([V1 V2],{'h=A','h=B'},'location','northwest','fontsize',12);
xlabel('x(mm)');
ylabel('y(mm)');
zlabel('z(mm)');
% For Top-view:-
h1=plot(x1,y1);
kk=boundary(x1,y1);
h11=patch(x1(kk),y1(kk),'r');
hold on
h2=plot(x2,y2);
kk=boundary(x2,y2);
h22=patch(x2(kk),y2(kk),'y');
alpha(0.25)
set(get(get(h1,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');
set(get(get(h11,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');
set(get(get(h2,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');
set(get(get(h22,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');

Answers (0)

Community Treasure Hunt

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

Start Hunting!