Set one common Xaxis for a sublot with rows = 1 and columns = 2
2 views (last 30 days)
I am having difficulties setting one shared\common Xaxis label for subplot with one row and two columns [e.g., subplot(1,2,1)].
Although there are a few realted answers in the forum, none seems to work for me.
I would appreciate your help!
dpb on 1 Aug 2022
Edited: dpb on 1 Aug 2022
I overlooked the labels in the original Q? body and thought was to have a combination axis itself of some sort based on title -- hence the response asking for clarification.
For the actual Q? as @the cyclist mentions above, use tiledlayout instead of subplot() which has been deprecated and won't be updated further it would appear.
From the doc examples for tiledlayout --
?Display a shared title and axis labels by passing t to the title, xlabel, and ylabel functions."
t = tiledlayout(2,2,'TileSpacing','Compact');
title(t,'Size vs. Distance')