您可以通过多种方式区分曲线:
-1-歪斜数据
如你所说,你可以稍微改变数据。我建议修理你的轴,然后计算线宽中的单位数,这样你就会非常紧凑,如下所示:
lineWidth = 5;
figure(33);
clf;
subplot(1,2,1);
h = plot(myData, 'linewidth', lineWidth);
xlim([1,5]);
ylim([1,5]);
title('Original');
myData = meshgrid(1:5)';
myLimDiff = diff(ylim);
set(gca,'units', 'pixels');
myPos = get(gca, 'position')
myWidthHeight= myPos(3:4)
PixelsPerUnit =myWidthHeight(2)./ myLimDiff;
myDataSkewed = myData + meshgrid(-2:2)*1/PixelsPerUnit(1)*lineWidth;
subplot(1,2,2);
plot(myDataSkewed, 'linewidth', lineWidth);
xlim([1,5]);
ylim([1,5]);
title('Skewed');结果:
-2-使用实线和破折号
正如其他人在评论中指出的那样,你可以在实线或某些样式组合上划一条虚线。
-3-使用不同的线条粗细
使用底部最厚的不同线宽:
figure(54);
clf
hold all
for ind = 10:-3:1
plot(1:5, 'linewidth', ind);
end
-4-每条线都使用单独的图表进行扭曲
调出每一行的另一种方法是在子图中绘制每条线,但首先以灰色绘制所有数据。通过这种方式,您可以看到每个特定行都被调出的所有行:
figure(55);
clf
data = rand(3);
for ind = 1:3
subplot(1,3,ind);
plot(data, 'linewidth', 4, 'color', [1 1 1]*.75);
hold on
plot(data(:,ind), 'linewidth', 2);
end