Why does "imagesc" shift the shape upward when plotting density?

When I am plotting the shape representing the density it shifts upwards slightly compared to the actual shape when using "imagesc". I expect both the shapes to be on the same location on the grid. How do I fix this?

 采纳的回答

To resolve this set the "YDir" to "normal". By default, the 'imagesc' functions invert the y-axis direction when the image is displayed on an axes by setting the "YDir" property to "reverse". To invert the y-axis direction, set the 'YDir' property to 'normal', as follows:
load clown
clims = [10 60];
imagesc(flipud(X),clims)
colormap(gray)
set(gca,'YDir','normal')

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 MATLAB 的更多信息

产品

版本

R2020a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by