you can set an alpha parameter when you save image with IMWRITE in PNG
format.
help imwrite
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/imwrite.html
Jérôme
You can remove (or change) the bg color in the following way:
set(gca,'color','none')
Go to "Edit -> Copy Options" menu, lake sure "Transparent background" is checked.
Copy the graphic "Edit Copy". The Transparent Image is in your clipboard. You can copy/past in your favorite software, and save it.
Bruno
My print2im function now supports transparent backgrounds when saving to png, with the added benefit of anti-aliased graphics:
http://www.mathworks.com/matlabcentral/fileexchange/22093
E.g.
>> peaks
>> print2im test.png -alpha
Set the 'color' property of the figure (and axes if you want) to 'none', then export the figure to the desired format using export_fig:
http://www.mathworks.com/matlabcentral/fileexchange/23629
A transparent background can be reproduced in pdf, eps and png formats.
Transparent patch objects and images are only correctly rendered when exporting to bitmap formats (as the painters algorithm used for generating vector format files does not support semi-transparent objects), and the only bitmap format to support transparency in the output image is png, i.e. exporting to png is the only way to maintain the transparency of objects in the output (when using export_fig), should you want this.