Multiple ylabels in tiledlayout

Cunxin Huang on 26 Mar 2024 (Edited on 12 Apr 2024)
Latest activity Edit by Christopher Stapels on 18 Apr 2024

Suppose I want to use tiledlayout to draw a 4*6 figure. Now I want to let the first and second row of figures share the same ylabels, and so do the third and the fourth. But I did not find a way to do this. I tried to create two different tiledlayout on one figure, but tiledlayout did not allow me to do so. Thus, any suggestions?
Christopher Stapels
Christopher Stapels on 11 Apr 2024 (Edited on 18 Apr 2024)
There is a great example of that near the end of the tilerowcol page.
I dont usually copy and paste, but I will here since I have it on the clipboard. Still, I'd go to the doc page for more ideas.
t = tiledlayout(4,4,TileSpacing="compact");
for i=1:16
nexttile
plot(rand(10,3))
end
% Remove select y- and x-axis tick labels
[row,col] = tilerowcol(t.Children);
yticklabels(t.Children(col>1),"")
xticklabels(t.Children(row<t.GridSize(1)),"")
title(t,"Tiling of 16 Plots")

Tags