New Reply

Matlab: Using imshow and mesh in the same plot

 
Share Thread Thread Tools
Oct3-11, 06:40 AM   #1
 

Matlab: Using imshow and mesh in the same plot


Hi,
I have written a piece of code to plot a greyscale image using imshow and a mesh plot using mesh in the same plot (the graphs are subplots in the smae figure. My problem is that when I use imshow the meshplot turns to greyscale rather than colour, and I can't worj out how to have one plot as greyscale and the other as colour.

My code is below if this helps;

%Script to show diffraction grating
clear all

M=dlmread('testslit5.txt','\t');

subplot(2,1,1),imshow(M);
title('Diffraction grating');

Mtransform=fft2(M);
Mtransform=fftshift(Mtransform);
N=max(max(Mtransform));
Mtransform=Mtransform/N;

subplot(2,2,3),mesh(abs(Mtransform));
title('Diffraction grating diffraction pattern (intensity)');
subplot(2,2,4),mesh(angle(Mtransform));
title('Diffraction grating diffraction pattern (phase)');

Thanks in advance
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Intel's Haswell to extend battery life, set for Taipei launch
>> Galaxies fed by funnels of fuel
>> The better to see you with: Scientists build record-setting metamaterial flat lens
New Reply

Tags
colour, greyscale, imshow, matlab, mesh
Thread Tools


Similar Threads for: Matlab: Using imshow and mesh in the same plot
Thread Forum Replies
how to do a 3d plot in matlab Math & Science Software 1
Matlab 3D plot General Engineering 2
plot in matlab Engineering, Comp Sci, & Technology Homework 1
3D Plot in Matlab Programming & Comp Sci 6
Matlab Plot Engineering, Comp Sci, & Technology Homework 1