Force tiledlayout('flow') to layout vertically
Mostrar comentarios más antiguos
The problem I have with tiledlayout('flow') is that it it will often end up arranging the plots in a 2x2 grid, rather than a 4x1.
I understand tiledlayout('flow') tries to keep a 4:3 ratio for plots, but this is not useful for my data.
Tiledlayout(x,1) won't work because I don't know x beforehand.
I had hoped that in the case of tiledlayout(x,1) I could set the GridSize property, but it is read only.
Any suggestions on how to overcome this would be helpful, thank you.
Respuesta aceptada
Más respuestas (1)
Srivardhan Gadila
el 20 de Ag. de 2020
Based on the above information and the documentation of tiledlayout & nexttile, for this particular problem you can make use of the 'nexttile(span)' syntax as follows:
% Let the max number tiles are maxTiles = 1000 (>>n or just >=n)
maxTiles = 1000;
x = linspace(0,30);
tiledlayout('flow')
n = randi([1 10]);
for i=1:n
nexttile([1 maxTiles])
y = rand(1,numel(x));
plot(x,y)
end
2 comentarios
Scott
el 20 de Ag. de 2020
michal.markun
el 26 de Ag. de 2025
Hi,
I have a follow up question. I can't find in Help how to add a scrollbar to a tiledlayout figure. It might be usefull if in your example above n is large, so that the tiles result squeezed.
I would be grateful for your help on this.
Best,
Mike
Categorías
Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

