matlab - Display an image on the X-Z plane (instead of the default X-Y) -


i can image plot on x-y plane using imagesc, have on x-z plane further usage. there way so? thanks!

i'd use surface instead of imagesc:

input = [3,4,5          4,5,6]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure();  zz = padarray(input,[1 1],0,'post'); % see note #2 [xx,yy] = meshgrid((1:size(input,2)+1)-0.5,(1:size(input,1)+1)-0.5); % imagesc subplot(3,1,1); imagesc(input); xlim([0 4]); ylim([0.5 2.5]); view([-50 50]); xlabel('x'); ylabel('y'); zlabel('z'); grid on; title('imagesc'); % normal (x-y): subplot(3,1,2); surface(xx,yy,0*xx,zz,'edgecolor','none','facecolor','flat');  view([-50 50]); xlabel('x'); ylabel('y'); zlabel('z'); axis ij; box on; grid on; title('x-y surface'); caxis([min(input(:)),max(input(:))]); % rotated (x-z): subplot(3,1,3); surface(xx,0*zz,yy,zz,'edgecolor','none','facecolor','flat'); view([-50 50]); xlabel('x'); ylabel('y'); zlabel('z'); axis ij; box on; grid on; title('x-z surface'); caxis([min(input(:)),max(input(:))]); 

several notes:

  1. you might need flipud or fliplr of inputs in 2nd surface plot (depending on how define y -> z transition).
  2. presentation-wise output same, but, if try compare values of nodes not same result between x-y , imagesc outputs. reason surface defined using vertices, , image object defined using value in center of each square.

output:

comparison of outputs


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -