2

我正在寻找一种同时导出包含线条和“冲浪”的抗锯齿图形的方法。

使用 HG2,默认情况下“绘图”线是抗锯齿的,但一旦我插入“冲浪”,抗锯齿就会关闭。我能得到的最接近的是使用“export_fig”,但它没有正确导出虚线。

r=100;
theta = linspace(0,2*pi,100);
[x,y] = pol2cart(theta,r*ones(1,100));
[x1,y1] = pol2cart(theta,0.9*r*ones(1,100));

rc = 0.1;
h = 0.3;
m = h/rc;
[R,A] = meshgrid(-linspace(0,rc,11),linspace(0,2*pi,50));
X3 = R .* cos(A)*r;
Y3 = R .* sin(A)*r;
Z3 = -(m*R+h)*r;


hold on
plot(x,y)
plot(x1,y1,'-.')

%plots are with anti-aliasing

s = surf(X3,Y3,Z3)


s.FaceLighting = 'gouraud';
s.AmbientStrength = 0.6;
s.DiffuseStrength = 0.8;
s.SpecularStrength = 0.9;
s.SpecularExponent = 25;
s.BackFaceLighting = 'reverselit';
s.FaceColor=[0.25 0.25 0.25];

set(s,'FaceAlpha',0.3);
set(s,'EdgeAlpha',0);

view(2)
%anti-aliasing is gone...
4

0 回答 0