y position of a rectangle drawn over an image compared to axes

1 回表示 (過去 30 日間)
ChiPhi85
ChiPhi85 2019 年 2 月 17 日
回答済み: Walter Roberson 2019 年 2 月 17 日
In the documentation, it states for drawrectangle or rectangle that the position of a rectangle is given by [xmin ymin width height].
If you plot a rectangle over axes, the ymin seems to correspond to the minimum y position from the bottom, but if you do it over an image it appears that the ymin is from the top of the image. Is this correct? Is there a reason for this?

採用された回答

Walter Roberson
Walter Roberson 2019 年 2 月 17 日
Depending on the state of the axes (hold on or not) and the image drawing function you use, it is common for the image drawing functions to automatically set YDir to 'reverse', because it is common that people want (1,1) of the data array to correspond to the top left corner.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by