About the use of imagesc

17 ビュー (過去 30 日間)
Richard Wood
Richard Wood 2023 年 3 月 25 日
回答済み: Adam Danz 2023 年 3 月 26 日
Dear all
I am using imagesc to generate a figure using MatLab.
I have something like this:
space_x=linspace(0,40,115);
space_y=linspace(0,40,85);
matrix=rand(length(space_x),length(space_y));
imagesc(space_x,space_y,matrix)
In this case, what I obtain is that the abscissa axis increases its numerical value to the right, and the ordinate one to the top, which is what I want. However, in my case the element matrix(1,1) corresponds to space_x=0 and space_y=0. I was wondering if the way that I am saying imagesc to plot the data it is consistent, and really displays the value of matrix which corresponds to each pair of space_x and space_y values.

回答 (1 件)

Adam Danz
Adam Danz 2023 年 3 月 26 日
> the abscissa axis increases its numerical value to the right, and the ordinate one to the top, which is what I want
I think you're asking how to flip the y-axis.
set(gca, 'YDir','normal')

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by