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!