【发布时间】:2014-07-02 12:43:36
【问题描述】:
我目前正在撰写一篇科学论文,对于创建具有我希望它们具有的确切尺寸的图形非常绝望。特别是字体大小不匹配。 我已经用谷歌搜索了很多,并且有很多关于这个主题的指南和脚本,但没有任何帮助 - 我还没有弄清楚(抱歉)为什么我的方法不起作用:
FS=8; %font size in points (the same as in my document)
width=12; %width of figure in cm
height=4; %height of figure in cm
scatter(1:20,rand(20,1));
xlabel('X','fontsize',FS),ylabel('Y','fontsize',FS),title('X vs. Y','fontsize',FS)
%now I scale the figure and place it in the bottom left corner. The white margins around it are cropped automatically
set(gca,'units','centimeters','outerposition',[0 0 width height])
%export as .eps
print(gcf,'-depsc','test')
当我将 test.eps 加载到 Inkscape 中时,该图为 10.16 x 3.529 厘米,字体大小(标题和轴标签)为 10。 如何获得具有精确缩放比例的图形,尤其是字体大小?
【问题讨论】:
-
旁注:如果您使用的是 Latex,可以查看psfrag 包。这允许您替换 eps 图中的字符串。因此,替换将具有与文本相同的字体和大小。
-
您可以尝试
PaperPosition图形属性。从描述来看,它似乎在做你想做的事。 -
@Schorsch
PaperPosition是诀窍,我曾经也为此苦苦挣扎,并且在网上搜索了几个小时。您应该将此作为答案发布。 -
@Schorsch @patrik 我已经尝试过 PaperPosition,但这也不能解决问题:
set(gcf,'paperunits','centimeters','papersize',[width height],'paperposition',[0 0 widht height]);导出时,图形仍然不是宽度 x 高度缩放
标签: matlab font-size scaling figure