MATLAB: Printing EPS file with a transparent slice

alpha mappingepsMATLABprinttransparency

Hello,
I am trying to print a figure with a transparent slice into an .eps file but it creates only a mess. Here is an example code:
data = randi(10,10,10,10); % generation of a random data
alphaLayer = 0.5*ones(10);
alphaLayer(3:8,3:8) = zeros(6); % creation of a layer for alpha mapping
figure;
hold all;
% slice through the data matrix
sliceHandle = slice(data,[],[],5);
% slice through the data which will be used to create the transparent slice
censoringHandle = slice(data,[],[],5);
% setting of color and alpha values for the transparent slice
set(censoringHandle,'FaceAlpha','flat','AlphaDataMapping','scaled','AlphaData',alphaLayer,'FaceColor','k')
print('-dpsc2','-r0','test.eps');
This code creates great Matlab figure and great png image but it doesn't work for .eps. I tried to play around with various settings – I tried all offered versions of .eps and both renderers but without any success. When I print same figure into .eps without the transparent layer it works great. Maybe it would be possible to "darken" the area in some other way but I have no clue how. I use OpenSuse 13.2 and GeForce 610M. Is this problem of Matlab or limitation of the .eps format? Any ideas on how to bypass this problem?
Thank you,
Honza

Best Answer

I am not familiar with your particular problem, but this submission has always helped me up to now to get my figures correct in other formats:
it should be able to deal with transparency in eps