Saving figures with transparent patches / objects - figure background turning black
3 views (last 30 days)
Show older comments
Initial Conditions on 28 Apr 2015
Commented: Initial Conditions on 29 Apr 2015
I have an issue trying to print (or save using export_fig etc.) a plot that has some transparent patches - these are histogram bars and the transparency has been set using 'facealpha' for example
When coming to print/save this figure, in the final saved figure the background colour is black. I've tried both the print and export_fig function to print to png but I can't get around this issue. Any ideas? Thanks.
Christiaan on 29 Apr 2015
Edited: Christiaan on 29 Apr 2015
Please try the following example. It makes an 3D plot, makes it transparant and saves it as a png.
clc;clear all;close all;
[x,y] = meshgrid([-2:.2:2]);
z = x.*exp(-x.^2-y.^2);
If you have plotted this figure, you can go in the figure GUI to edit-> copy figure. Now, if you paste this in a text programm (i.e. Word) you obtain a transperant figure also in Word.
Good luck! Christiaan
Find more on Printing and Saving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!