Simple problem with plotting

1 回表示 (過去 30 日間)
cocopuffs
cocopuffs 2014 年 8 月 14 日
回答済み: cocopuffs 2014 年 8 月 14 日
I have a 4X40 matrix of intensity values 'mat' that I am plotting using figure;imagesc(mat). However, when I do plot this, the first is row is plotted on .5 on the y-axis. As a result, each row is represented in multiples of .5 instead of 1 on the y-axis. My y-axis spans from .5 to 4.5 which is incorrect - it should be 1 to 4. Please help.
Thank you!

採用された回答

cocopuffs
cocopuffs 2014 年 8 月 14 日
I changed my code to figure;imagesc(1,1,mat) to get the answer I was looking for

その他の回答 (1 件)

Adam
Adam 2014 年 8 月 14 日
This is due to the fact that the centre of the first pixel is placed at 1, but it spans from 0.5 to 1.5, the second pixel from 1.5 to 2.5, etc because pixels have a width of 1.
If your axes started at 1 then your final pixel would start at 4 and actually finish at 5 so your range would be 1 to 5 on the axes.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by