Change figure size based on the number of nexttile

조회 수: 19 (최근 30일)
Chappi
Chappi 2022년 5월 15일
댓글: Chappi 2022년 5월 16일
I want to generate a figure of many imagesc using tiledlayout('flow'). How can I make my figure size adjust depending on the number of nexttile used in a loop? Is there any way I can set the size for each individual in tiledlayout? So that the figure appreance will not depend on the number of loop iteration.
I found some thing similar with what I am looking for here but I want to do it in a reserve way
Thank you

답변 (1개)

dpb
dpb 2022년 5월 15일
편집: dpb 2022년 5월 15일
Well, when you use the 'flow' option, that's what you've told tiledlayout you want -- the size/location of the figures to update dynamically when each nexttile call comes.
If you want a fixed layout, then use the tiledlayout(m,n) option where you define how many and the orientation a priori and then fill in the content when you get there.
There are some options to control the amount of whitespace between tiles to adapt the appearance but individual axes positions/sizes are not modifiable with the 'Position'properties of a normal axes object.
There is an ability to nest layouts to create nonuniformly-sized charts, see the properties documentation 'Layout' property for the details on that.
But, if you don't want the sizes changing dynamically, don't use 'flow'
  댓글 수: 5
dpb
dpb 2022년 5월 16일
AHa! That, indeed, is a different problem. Yes, you can make the figure width/height a function of the m,n layout numbers. NB: you can retrieve the actual monitor pixel size from the groot stucture that can give you the limits of the current monitor that you could scale to.
Chappi
Chappi 2022년 5월 16일
I will look into groot that you mention, have never heard of it before. Thank you v much!!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by