How do I change the x and y coordinates in a colormap?

조회 수: 7 (최근 30일)
Yixin Shao
Yixin Shao 2019년 2월 11일
답변: Adam 2019년 2월 11일
I have a 2-D array fourier tranaformed with each value in it indicates the value at a certain frequency and wavevector(each row represent a frequency with interval df and each column represent a wavevetor with interval dk), when I use "imagesc" to plot, the coordinate on x-axis and y-axis show the number of the column and row, how can I change it into the position and time I want? Like for [i,j], the coordinate should be (i*dk,j*df).
Y = fft2(array);
Yshift = fftshift(Y);
f1 = figure;
imagesc(abs(log(Yshift)));
colorbar;
resultft.png

답변 (1개)

Adam
Adam 2019년 2월 11일
doc imagesc
shows that the first two arguments can be the x data and the y data if you use the 3-argument syntax or property-value pairs to explicitly set XData and YData.
Alternatively, if you keep the handle from your imagesc call:
hImage = imagesc(...)
you can change
hImage.XData = ...
hImage.YData = ...
to appropriate values.

카테고리

Help CenterFile Exchange에서 Blue에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by