フィルターのクリア

How could I know the size of a square box?

2 ビュー (過去 30 日間)
Md Borhan Mia
Md Borhan Mia 2018 年 5 月 26 日
コメント済み: Image Analyst 2018 年 5 月 27 日
I want to know the square box size in each case. How could I know that?
Thanks in advance!
  2 件のコメント
Ameer Hamza
Ameer Hamza 2018 年 5 月 26 日
Size in which units? Pixels?
Md Borhan Mia
Md Borhan Mia 2018 年 5 月 26 日
I want two boxes will have the similar size irrespective of xlabel or ylabel. Size will be inches or pixels but that doesn't matter as long as I have similar box size.

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

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 5 月 26 日
You can make their figure size equal by changing the Position property of the axes object. For example, select the first figure window and run the following line
set(gca, 'Position', [0.13 0.13 0.75 0.75])
and then select the second figure window and run the same line again. It will make both axes of equal width inside the figure window. It will, however, move the text outside the boundary of the figure window. To move the text inside you will need to change the with and height of axis by changing the vector in the above statement.

その他の回答 (1 件)

Image Analyst
Image Analyst 2018 年 5 月 26 日
編集済み: Image Analyst 2018 年 5 月 27 日
If it's the image size, you can do
[rows, columns, numberOfColorChannels] = size(rgbImage);
If it's the size of the axes in the units you plotted, you can use
xl = xlim()
yl = ylim()
This will give you the min and max value that is displayed for each axis direction.
If it's the size of the graph in screen units, use
ax = gca;
rect = ax.Position; % An array of [xLeft, yBottom, width, height]
  1 件のコメント
Image Analyst
Image Analyst 2018 年 5 月 27 日
Regarding your edit today so that all your question says now is "I want to know the square box size in each case. How could I know that?", what is the box? What are the different cases? Is "the box" an image or a graph/plot? Can you attach a screenshot, if it's still a problem?

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by