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