- You are working with R2019b and you can use 'tiledlayout()' function to combine multiple axes together into a common figure. Refer the following documentation for more details: https://www.mathworks.com/help/releases/R2019b/matlab/ref/tiledlayout.html
- Below is a sample code for exporting the figure object as a pdf:
Resize uifigure to fit DIN A4 when exported
5 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am currently working on a research paper. I have written some functions to create figures from large datasets. Since I have to use version r2019b, instead of nested TiledLayout-Objects I had to use uifigure and uigridlayout-objects to join different axes into one large uifigure. Now I cannot find any way to size the uifigure, so that when exporting (via hgexport() ) it automatically fits a DIN A4 page. Resizing the exported file is not an option, since for the paper I need to be consistent with the font sizes. In the R2019b Version, one also cannot change the Units of the uifigure to cm, for example. Do any of you have ideas for workarounds. Any answer ist very welcome. Thanks in advance.
LG Leon
0 个评论
回答(1 个)
Divyanshu
2023-11-16
Hi Leon,
I understand that you want to export a figure which is a combination of multiple axes, as a pdf of A4 size. Refer the following pointers for better understanding:
f = figure;
tiledlayout(f,1,2);
nexttile;
x = linspace(1,10,2);
y = 2*x + 3;
plot(x,y);
nexttile;
y = 3*x+7;
plot(x,y);
set(f,'Units','Inches');
pos = get(f,'Position');
set(f,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[8, 10])
print(f,'myfigure','-dpdf','-r0','-fillpage')
Note that the values specified for 'PaperSize' in 'set' function should be modified according to the use-case which for you would be the dimensions of A4-size paper.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!