Printing EPS file with a transparent slice

6 ビュー (過去 30 日間)
Jan Chyba
Jan Chyba 2015 年 10 月 16 日
コメント済み: Jan Chyba 2015 年 10 月 16 日
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

採用された回答

Ingrid
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
  1 件のコメント
Jan Chyba
Jan Chyba 2015 年 10 月 16 日
Thank you, Ingrid! This seems to be working!

サインインしてコメントする。

その他の回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by