Save figure in Matlab without borders

59 次查看(过去 30 天)
I am experiencing several troubles in exporting figures in matlab. Typically I save figures in eps format and then I try to convert them in pdf using eps2pdf. The results is a figure with a huge white border around. How can I remove it and get a proper figure? I tried with
set(gca,'LooseInset',get(gca,'TightInset'));
with commands:
export_fig
print
Without any success. Unfortunately if I try
system('pdfcrop .... ')
does not work in mac, it returns the error
>> system('pdfcrop')
/bin/bash: pdfcrop: command not found
Nevertheless pdfcrop is installed because if I launch it from the terminal it works fine and the removes the borders correctly.

采纳的回答

James Tursa
James Tursa 2015-11-19
You might take a look at this FEX submission by Yair Altman:
  1 个评论
Davide
Davide 2015-11-20
Thanks, the output now is much better. Using
export_fig([name_fig,'.pdf'], '-pdf','-transparent');
I get a very nice figure.

请先登录,再进行评论。

更多回答(1 个)

thomas weldon
thomas weldon 2018-6-21
Try this: fig=gcf;ax=fig.CurrentAxes;fig.Color='w';fig.OuterPosition=fig.InnerPosition;

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by