How to show transparent part of a figure in an eps file ?
3 次查看(过去 30 天)
显示 更早的评论
I have been in a strugule and I realy need some help.
I am trying to export a figure to an eps file to use it and it contain a transparent line
but it doesnot show in the eps file.How can I solve this problem?
this is what it should appeare:
but when I save it as eps and use it this is what I get:
I have to use eps file. Thank you in advance.
this the code I am using
clc
close all
alpha=7.64;
delta1=0.18;
eta1=1.26;
gamma=.4;
psi=0.9;
phi=7;
% Create axes
axes1 = axes('Position',...
[0.044642857142857,0.10952380952381,0.908928571428571,0.854761904761909]);
hold(axes1,'on')
box(axes1,'on');
I1=@(s) (psi*(-delta1-s*eta1-(gamma+eta1)*psi+(alpha*psi)/(s+psi)));
I2=@(s) ((alpha*psi^2)/(s+psi)-psi*(delta1+s*eta1+(gamma+eta1)*psi+phi));
fplot(I1,[-0.89 3],'Color',[0 0 .5],LineWidth=2)
hold on
fplot(I2,[-0.89 3],'Color',[0.9 0 0],LineWidth=2)
hold on
smax=-((delta1+gamma*psi+2*eta1*psi-sqrt(delta1^2+4*alpha*eta1*psi+2*delta1*gamma*psi+(gamma*psi)^2))/(2*eta1));
smin=-((delta1+phi+gamma*psi+2*eta1*psi-sqrt(delta1^2+4*alpha*eta1*psi+2*delta1*(phi+gamma*psi)+(phi+gamma*psi)^2))/(2*eta1));
line([0 3],[0 0],'LineStyle','--','Color',[0.4660 0.6740 0.1880],'LineWidth',2)
blulecolor=[0.4940 0.1840 0.5560 0.4];
line( [0 smax],[0 0],'LineWidth',5,'Color',blulecolor)%the trancparent line
hold on
plot(smax,0,'MarkerFaceColor',[0.4940 0.1840 0.5560],...
'Marker','o',...
'LineWidth',1,...
'LineStyle','none',...
'Color',[0.4940 0.1840 0.5560])%,xs1,ys1,'ob')
hold on
plot(smin,0,'MarkerFaceColor',[0.4940 0.1840 0.5560],...
'Marker','o',...
'LineWidth',1,...
'LineStyle','none',...
'Color',[0.4940 0.1840 0.5560])
xlim([-2 2])
ylim([-10 10])
x=xlabel('$s(t)$','Interpreter','latex');
set(x, 'FontSize',14)
set(x,'FontWeight','bold')
set(axes1,'XTick',0,'YTick',0,'YTickLabel',{'0'});
set(axes1,'GridColor',[0 0 0]);
grid on
% print('yourTransparentImage','-depsc','-vector')
0 个评论
回答(1 个)
Walter Roberson
2022-12-18
Postscript (eps) does not support transparency https://stackoverflow.com/questions/29321707/can-transparency-be-used-with-postscript-eps
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!