您可以區分曲線在幾個方面:
-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-使用單獨繪製每個線扭曲
An另一種調出每條線的方式是繪製一條子圖中的每條線,但首先將所有數據繪製成灰色。這樣,您就可以看到所有的線與叫出每個特定行:
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
正如你可以使用linestyles像一個解決方法''--o''即離開下層線可見。 – Deve 2012-02-22 15:22:58
使用另一個維度怎麼樣?使用'plot3'進行繪圖並給每個繪圖一個不同的z值。然後將視角設置爲適當的值。 – 2012-02-22 17:34:48
@Deve that does not work,the spaces falling on the same area in all plots – Daniel 2012-03-01 10:18:11