2015-11-20 47 views
1
縮放

我試圖生成以下八度代碼2D情節:更改情節倍頻

x_axis = [0, 2000, 4000, 6000, 8000, 10000, 12000, 14000, 16000, 18000, 20000, 22000, 24000, 26000, 28000, 30000, 32000, 34000, 36000, 38000, 40000, 42000, 44000, 46000, 48000, 50000, 55000]; 
y_axis = [0.0, 1.1362139943230667, 3.011725480219328, 4.545131757387976, 5.645494339268811, 6.341632245863471, 7.55485783191341, 9.698082845719652, 9.81715090204222, 8.629366029821481, 7.01446673437068, 5.947197763974984, 5.318901760924856, 4.383110951158656, 3.829896079165435, 3.1783656030517826, 2.547173908996705, 2.0871037643293615, 1.6803970681818023, 1.3409807153873572, 1.0809200851333154, 0.8306496482769604, 0.7009640582695764, 0.565624976300148, 0.4724802489742704, 0.30894265221854744, 2.333168554726147]; 

plot(x_axis, y_axis, '-o'); 
axis([0 55000 0 12], "tic[xy]"); 

set(gca, 'xtick', 0:52000:2000) 
set(gca, 'xticklabel', {'0', '2000', '4000', '6000', '8000', '10000', '12000', '14000', '16000', '18000', '20000', '22000', '24000', '26000', '28000', '30000', '32000', '34000', '36000', '38000', '40000', '42000', '44000', '46000', '48000', '50000', '55000'}) 

我有y軸縮放我想要的方式,但我希望這是蜱在x軸上對應於我正在繪製的每個x值。當我真的喜歡x軸比y軸長時,Octave似乎強制圖形具有方形寬高比。我如何強制Octave做到這一點?謝謝!

回答

0

我想你可以試試pbaspect,它允許你在顯示x軸,y軸和z軸時設置比例。例如,如果你希望X軸在二維圖上是y軸的兩倍,你應該寫出pbaspect([2 1 1])

它適用於MATLAB,我相信它也可用於GNU Octave。

希望這會有所幫助。

+0

是的,這與其他一些調整相結合,爲我做了。謝謝! – Danny