MATLAB中的反别名行与标记

时间:2013-01-22 10:31:46

标签: matlab plot antialiasing

嗨,我在MATLAB中有一个图像

enter image description here

我希望线条平滑 - 看看从0.4到0.8的线......这太可怕了。 当使用'LineSmoothing','on'操作符时,我得到了这个

enter image description here

我在线条上做得很好,但它也能平滑标记,而且它们太可怕了!

如何让MATLAB仅平滑线而不是标记?

以下是代码:

clear all;
close all;

bpp = [0.8 0.4 0.2 0.1 0.05];
bpp_j = [0.8 0.4 0.2 0.1];
AAE_JPEG = [1.65 2.91 6.20 10.96];
AAE_JPEG_2000 = [1.39 2.29 3.78 6.75 12.52];
AAE_EEDC = [2.08 2.67 3.80 5.94 9.31];
hold on;
plot(bpp_j, AAE_JPEG, 'k','LineWidth',1.5,'MarkerSize',9,'MarkerEdgeColor','k','LineSmoothing','on');
plot(bpp, AAE_JPEG_2000, 'k', 'LineWidth',1.5,'MarkerSize',6,'MarkerEdgeColor','k','LineSmoothing','on');
plot(bpp, AAE_EEDC, 'k', 'LineWidth',1.5,'MarkerSize',6,'MarkerEdgeColor','k','LineSmoothing','on');

plot(bpp_j, AAE_JPEG, 'x','LineWidth',1.5,'MarkerSize',8,'MarkerEdgeColor','k');
plot(bpp, AAE_JPEG_2000, 'o', 'LineWidth',1.5,'MarkerSize',6,'MarkerEdgeColor','k');
plot(bpp, AAE_EEDC, 'v', 'LineWidth',1.5,'MarkerSize',6,'MarkerEdgeColor','k');

LL = plot(rand(1,2),rand(1,2),'k-x','visible','off','LineWidth',1.5,'MarkerSize',8);
LK = plot(rand(1,2),rand(1,2),'k-o','visible','off','LineWidth',1.5,'MarkerSize',6);
LI = plot(rand(1,2),rand(1,2),'k-v','visible','off','LineWidth',1.5,'MarkerSize',6);
legend([LL,LK, LI],'JPEG','JPEG 2000','EEDC')


axis([0 0.9 0 14])
xlabel('bpp');
ylabel('AAE');
grid on;

虽然我还在这里......我怎样才能在x轴上显示0.05 0.1 0.2 0.4和0.8?

2 个答案:

答案 0 :(得分:4)

我只是尝试使用export_fig,甚至没有linesmoothing行......

答案 1 :(得分:3)

我这里没有MATLAB所以我无法测试但是如果你绘制没有标记的平滑线条它会起作用

plot(bpp_j, AAE_JPEG, 'k','LineWidth',1.5,'LineSmoothing','on');

那么没有线条的标记的另一个图?

plot(bpp_j, AAE_JPEG, 'x','MarkerSize',8,'MarkerEdgeColor','k');

关于x轴刻度,请参阅matlab x axis label set as a vector