Printing EPS file with a transparent slice

28 views (last 30 days)
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

Accepted Answer

Ingrid
Ingrid on 16 Oct 2015
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
  1 Comment
Jan Chyba
Jan Chyba on 16 Oct 2015
Thank you, Ingrid! This seems to be working!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!