issue with MATLAB figure
显示 更早的评论
I create a figure xx.fig, now I save it as: xx.jpg. Eveything is fine. Now I made a copy of this file yy.fig because I need to modify the font size to have better resolution. Only I increased the font from 220 to 22. When I save the file as jpg, it gives me bad resolution compared with the previous one. What is the reason? I can not modify the font.
Thanks inadvance for your quick response.
Aymen
This one is font 20

This one is font 22 but it looks worse inside word document

回答(1 个)
Hi Aymen Zreikat,
Please have a look at the export function you use. I recommend to use print() since it comes with several configuration options.
close all
data = rand(1,100);
data = [1:100; data];
fh = figure;
ah = axes(fh);
plot(ah,data(1,:),data(2,:))
ah.XLabel.String = 'Cell Radius (km)';
ah.YLabel.String = 'Max Nr. of User (-)';
ah.XLabel.FontSize = 22;
ah.YLabel.FontSize = 22;
print(fh,'TestFigure','-djpeg','-r0')
Kind regards,
Robert
4 个评论
AYMEN ZREIKAT
2022-10-4
Robert U
2022-10-5
Hi Aymen Zreikat,
storing jpg-files from figure editor changes resolution to standard value. According to documentation saveas() standard resolution is 150 dpi which is quite low for publication ready illustrations. The method I introduced to you, allows you to save your figures in actual screen resolution which is triggered by the "-r0" command.
If you want to save your figure in any defined resolution I recommend my answer here: https://de.mathworks.com/matlabcentral/answers/415952-plot-resolution-and-size?s_tid=srchtitle
Saving high-res pixel graphics is only possible using command line according to my knowledge.
AYMEN ZREIKAT
2022-10-5
Robert U
2022-10-5
Thank you for your positive feedback. If you like my answer, please, vote for it by clicking on the "thumb up"-symbol.
In case it serves your needs and answers your question thoroughly, accept it.
Kind regards,
Robert
类别
在 帮助中心 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
