How do I flip an axis using imagesc?

93 ビュー (過去 30 日間)
Sebastian Pichler
Sebastian Pichler 2020 年 8 月 1 日
コメント済み: Image Analyst 2020 年 8 月 4 日
I want to display the Matrix eta (7x16) by using the imagesc function. I use the code:
T=[360 660]
p=[64 250]
imagesc(T,p,eta)
which produces the follwing image:
Now I want to flip the y-axis so that 50 is at the bottom and 250 is at the top. The Image should flip as well. Using
eta=flipud(eta)
T=[360 660]
p=[64 250]
p=fliplr[p]
imagesc(T,p,eta)
doesn't work. Thank you!

採用された回答

Image Analyst
Image Analyst 2020 年 8 月 1 日
Do you mean like with axis xy?
[x, y] = meshgrid(1:16, 1:7)
eta = uint8(rescale(sqrt(x.^2 + y.^2), 0, 255));
T=[360, 660];
p=[64, 250];
subplot(2, 1, 1);
imagesc(T,p,eta)
axis('on', 'image');
subplot(2, 1, 2);
imagesc(T,p,eta)
axis('on', 'image');
axis xy
  2 件のコメント
Sebastian Pichler
Sebastian Pichler 2020 年 8 月 3 日
Yes, your code works. Thank you!
Image Analyst
Image Analyst 2020 年 8 月 4 日
Then the usual thing to do to thank people is to "Accept this answer". Thanks in advance.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by