MATLAB: Is the title with multiple lines for PLOTYY cut off in MATLAB 7.8 (R2009a)

MATLAB

When I execute the following code, the top part of the title in the resulting plot is truncated:
f = figure;
plotyy(1:10, 1:10, 1:10, 1:2:20)
titStr = sprintf('xxx Signal Strength (EbNo) & Status vs TOW - xxxx1B, xxxxx Dump %s\nDataset: %s', datestr(today), 'test');
g = title(titStr);

Best Answer

This is an issue with the way MATLAB handles a title with multiple lines for a plot created by PLOTYY in MATLAB 7.8 (R2009a).
As a workaround, increase the height of the figure to display the entire title. For example,
f = figure;
plotyy(1:10, 1:10, 1:10, 1:2:20)
titStr = sprintf('xxx Signal Strength (EbNo) & Status vs TOW - xxxx1B, xxxxx Dump %s\nDataset: %s', datestr(today), 'test');
g = title(titStr);
set(g,'units', 'pixels')
pos_title = get(g,'extent');
set(g, 'units','normalized')
pos_fig = get(f, 'position');
set(f, 'position', [100 100 pos_fig(3) pos_title(2)+pos_title(4)+180+38]);
pos_fig = get(f,'position');
Please note that the numeric values for the position vector of the figure, 'f', may vary depending on the height of the title.