direction of Y Axis is changing

1 visualización (últimos 30 días)
Mohannad Ajamieh
Mohannad Ajamieh el 27 de Mayo de 2022
Comentada: Mohannad Ajamieh el 1 de Jun. de 2022
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')

Respuestas (2)

Jonas
Jonas el 27 de Mayo de 2022
calling
set(gca,'XDir','normal');
should be enough
  2 comentarios
Walter Roberson
Walter Roberson el 27 de Mayo de 2022
YDir
Mohannad Ajamieh
Mohannad Ajamieh el 30 de Mayo de 2022
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.

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 30 de Mayo de 2022
[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 comentarios
Walter Roberson
Walter Roberson el 31 de Mayo de 2022
What is your current code?
Mohannad Ajamieh
Mohannad Ajamieh el 1 de Jun. de 2022
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')

Iniciar sesión para comentar.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by