I'm using a Matlab Live script in which I'd like to use some subfigures. As the Standard figure size only uses a small section of the screen widths, I tried to enlarge the figure as follows:
h = figure;
subplot(1,2,1);
subplot(1,2,2);
set(h, 'Position', [0 0 1000 500])
This works entirely fine, for 'normal' figure Windows, but appearently not for in-line figures in live scripts.
As to be seen from the screenshots below, in the live script, the figure's size only increases to a small amount (fig. 1 -> fig. 2) and even decreases after a certain width (fig. 3).
Any ideas on how I can further increase the used pagewidth in the live script, or hints on what I'm doing wrong are appreciated.
Thanks
fig. 1
fig. 2
fig. 3
An alternative approach that seems to work for me (R2020b) is to use normalized units when declaring the position:
h = figure();
subplot(1,2,1);
subplot(1,2,2);
set(h,'Units','normalized','Position',[0 0 1 .5]);
The first two elements of the Position array tell MATLAB where to place the bottom-right corner (position (0,0)) whereas the last two elements determine the figure's X and Y size. The above snippet results in figures as large as the text, as seen here: image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With