Printing EPS file with a transparent slice
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Ingrid
2015-10-16
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!