在網上發現如下codes,可以生成透明圖形。
% If you ever wondered how to get a matlab figure transparent (particularly usefull when you export it to formats that feature transparency, like eps, gif, png, etc.), here is how you do it:
% you created a figure and it is "current". % the following, you could have guessed
set(gcf,'color','none');
set(gca,'color','none');
% but this following little detail took me ages to figure out
set(gcf,'InvertHardCopy','off');
打開一個.fig的文件,在command中運行上面三行命令 Edit->Copy Figure->在powerpoint中粘貼,就得到背景透明的圖片。