PNG vs. FIG File format - saveas function query
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I've been using the saveas function in my code to save the .fig files. However, the format of the .PNG file is quite different. The PNG file looks (size/ font) is different to the .fig plot.
But when I manually saveas from the matlab figure, File-->Save As (save as a PNG file), it saves it correctly without any change in the figure properties.
Is it something that we can make it similar to the .fig file?
Appreciate any responses, thanks in advance!
-Ferdinand
1 个评论
Rik
2018-4-20
Do you mean you want to save the figure contents to a png, just as when you would make a screen capture? If so, there is a submission on the FEX that does just that and is compatible with just about every conceivable Matlab release.
采纳的回答
Jan
2018-4-21
the format of the .PNG file is quite different
It depends on what you save in the PNG, or in other word, if you save a screenshot or use print to create a PNG with modified properties.
To get a copy of the appearance of the figure:
F = getframe(FigHandle); if isempty(F.colormap) RGB = F.cdata; else RGB = ind2rgb(F.cdata, F.colormap); end imwrite(RGB, FileName, 'png');
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!