Skip to content

Instantly share code, notes, and snippets.

@schluppeck
Last active July 22, 2022 17:09
Show Gist options
  • Save schluppeck/ea4d8cad02383ba6d7fdde5cf30f26d6 to your computer and use it in GitHub Desktop.
Save schluppeck/ea4d8cad02383ba6d7fdde5cf30f26d6 to your computer and use it in GitHub Desktop.
tiled layout with new matlab functions
%% example of tiled plots with shared axes and labels
%
% ds 2022-07-22
figure()
nRows = 4;
nCols = 4;
t = tiledlayout(nRows,nCols,'TileSpacing','Compact');
for iRow = 1:nRows
for iCol = 1:nCols
nexttile
plot(rand(1,20))
% for debugging (tile specific title)
% title(sprintf('r,c [%d, %d]', iRow, iCol))
end
end
%% share title, axes, etc.
title(t,'Shared title: pRF plots')
xlabel(t,'Time (TRs)')
ylabel(t,'fMRI reponse (% signal change')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment