direction of Y Axis is changing

조회 수: 3 (최근 30일)
Mohannad Ajamieh
Mohannad Ajamieh 2022년 5월 27일
댓글: Mohannad Ajamieh 2022년 6월 1일
when I plot an image in point form the direction of Y Axis is changing!
how can I make 0-Y and 0_X in the same position
there is three dimention because I worke on volume image
label=I;
[X,Y,Z]=meshgrid(1:size(label,1),1:size(label,2),1:size(label,3));
label=label>0; % für logischen Eintrag
Data=label; % Für Farbeintrag
ind=Data(:)>0; % keine Null - einträge
px=X(ind);
py=Y(ind);
pz=Z(ind);
color=double(Data(ind));
%% point plot
set(gca,'YDir','normal')
plot3(px,py,pz,'.')
xlabel('X µm')
ylabel('Y µm')
zlabel('Z µm')

답변 (2개)

Jonas
Jonas 2022년 5월 27일
calling
set(gca,'XDir','normal');
should be enough
  댓글 수: 2
Walter Roberson
Walter Roberson 2022년 5월 27일
YDir
Mohannad Ajamieh
Mohannad Ajamieh 2022년 5월 30일
Sorry it does not work.
As you can see in the code, I already included it .......set(gca,'YDir','normal')..... and I also tried the 'reverse' but it does not work too.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2022년 5월 30일
[X,Y,Z]=meshgrid(1:size(label,1),1:size(label,2),1:size(label,3));
That is incorrect. size(label,1) is the number of rows, and rows correspond to Y not to X. size(label,2) is the number of columns, and columns correspond to X not to Y.
  댓글 수: 5
Walter Roberson
Walter Roberson 2022년 5월 31일
What is your current code?
Mohannad Ajamieh
Mohannad Ajamieh 2022년 6월 1일
clear all
close all
names=dir('......source folder.........');
for iii=1:size(names,1)
I(:,:,iii)=imread(strcat('........source folder..........',names(iii).name));
for j=1:size(names,1)
Img_3D=surface('XData',[0 75;0 75],'YData',[0 0;75 75],'ZData',[0.2985*j 0.2985*j;0.2985*j 0.2985*j], 'CData' ,flipdim(im2double(I(:,:,iii)),1),'FaceColor','texturemap','EdgeColor','none');
colormap(gray)
xlabel('10*x mm')
ylabel('10*y mm')
zlabel('10*z mm')
end
end
label=I;
[X,Y,Z] = meshgrid(1:size(label,2),1:size(label,1),1:size(label,3));
label=label>0; % für logischen Eintrag
Data=label; % Für Farbeintrag
ind=Data(:)>0; % keine Null - einträge
px=X(ind);
py=Y(ind);
pz=Z(ind);
color=double(Data(ind));
%% punkt plot
plot3(px,py,pz,'.')
title('punkt darstellung')
xlabel('X mm')
ylabel('Y mm')
zlabel('Z mm')

댓글을 달려면 로그인하십시오.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by