Save image without the white margin

1 次查看(过去 30 天)
Nour
Nour 2015-1-21
编辑: Nour 2015-1-23
Hi, Please I want to use the HGEXPORT function as shown:
hgexport(gcf, 'figure1.jpg', ...
hgexport('factorystyle'), 'Format', 'jpeg');
hgexport(gcf, 'L2w.jpg', hgexport('factorystyle'), 'Format', 'jpeg');
But, I dont need the white margin around the image.

回答(1 个)

Chad Greene
Chad Greene 2015-1-21
There are many solutions. The best standby solution is to (almost) always use export_fig. It crops the white space by default unless you specify the -nocrop option.
  1 个评论
Nour
Nour 2015-1-23
编辑:Nour 2015-1-23
Please I need more explanation about using export_fig.
In fact, every thing was normal before I change my system to windows 8. Now I have a problem with the following commands:
hgexport(gcf, 'L2w.jpg', hgexport('factorystyle'), 'Format', 'jpeg');
There is a white margin around the image, in windows 7 I didn't have this problem as the image is saved without any margin, it seems so strange to have this problem now.
Please check out the 2 images attached.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by