フィルターのクリア

In subplot, how do I plot all images in same size?

32 ビュー (過去 30 日間)
Queila Martins
Queila Martins 2017 年 5 月 9 日
コメント済み: Queila Martins 2017 年 5 月 10 日
Hi,
I'm trying to use subplot to show a ranking of images. I've been trying to understand how to change the code to get all images in the same size when I show then in a figure, but with no success until now.
I've attached my image rankings so you can have an idea. To print that, I read a list of images from a .txt file and then I use a for loop to print each of those.
I would like them to have the same height and width, even if they have different size. Can anybody give me a hint? I've tried a lot of similar examples, but I still didn't understand how to do it. They could be the same size of first image that appears in the ranking.

採用された回答

Walter Roberson
Walter Roberson 2017 年 5 月 9 日
Use image() to draw the images instead of imshow().
And do not use the
axis image
or
axis equal
commands.
For example,
foo1 = randi(255,20,30,'uint8');
foo2 = randi(255,25,30,'uint8');
subplot(1,2,1); image(foo1)
subplot(1,2,2); image(foo2)
The images will be drawn the same size.
This will typically result in most of the images looking distorted.
  1 件のコメント
Queila Martins
Queila Martins 2017 年 5 月 10 日
Thank you SO much, Walter! I was really doing wrong things (using axis equal, imshow, etc). I merged your suggested code with set(gca...) and I got exactly what I needed.
Thank you so much again! very helpful!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by