How to give one x and y axis label when using tiled layout(‘flow’)?
I am using tiled layout(‘flow’) to plot a series of 20 plots on one figure. I want to have just one x and one y label for the entire figure, but when I try using the following code I get a figure that plots every subplot over each other.
figure()
t=tiledlayout(‘flow’);
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile(t)
plot(lag(:,ii),autoCorr(:,ii))
end
title(t,’title’)
xlabel(t,’xlabel’)
ylabel(t,’ylabel’)
When I use this code the plot works fine but I’m not sure how to add the x and y axis labels.
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
figure()
tiledlayout(‘flow’)
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile
plot(lag(:,ii),autoCorr(:,ii))
% xlim([100,fmax])
endI am using tiled layout(‘flow’) to plot a series of 20 plots on one figure. I want to have just one x and one y label for the entire figure, but when I try using the following code I get a figure that plots every subplot over each other.
figure()
t=tiledlayout(‘flow’);
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile(t)
plot(lag(:,ii),autoCorr(:,ii))
end
title(t,’title’)
xlabel(t,’xlabel’)
ylabel(t,’ylabel’)
When I use this code the plot works fine but I’m not sure how to add the x and y axis labels.
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
figure()
tiledlayout(‘flow’)
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile
plot(lag(:,ii),autoCorr(:,ii))
% xlim([100,fmax])
end I am using tiled layout(‘flow’) to plot a series of 20 plots on one figure. I want to have just one x and one y label for the entire figure, but when I try using the following code I get a figure that plots every subplot over each other.
figure()
t=tiledlayout(‘flow’);
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile(t)
plot(lag(:,ii),autoCorr(:,ii))
end
title(t,’title’)
xlabel(t,’xlabel’)
ylabel(t,’ylabel’)
When I use this code the plot works fine but I’m not sure how to add the x and y axis labels.
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
figure()
tiledlayout(‘flow’)
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile
plot(lag(:,ii),autoCorr(:,ii))
% xlim([100,fmax])
end tiled layout, tiledlayout, tiles, plot, subplot MATLAB Answers — New Questions