作者s0310388 (沒人要兄弟)
看板MATLAB
標題[繪圖] 4張圖已用plotyy合成,右邊y軸要怎改範圍?
時間Sat Jan 5 17:48:38 2013
網路上的大大你好
我參考板上之前發文,把4張圖合成一張
程式碼為
[AX,HDv1,ADv1]=plotyy(w/(2*pi),[20*log10(mag);20*log10(mag1)],
w/(2*pi),[phase;phase1],@semilogx);
但我要調整右邊y軸時,發現範圍無法調到0~-360
圖形為
http://ppt.cc/JxAO
我改變範圍的程式碼為
set(AX(1),'xLim',[0 1e4])
set(AX(2),'xLim',[0 1e4])
set(AX(1),'YLim',[0 50])
set(AX(1),'YTick',[0:10:50])
set(AX(2),'YLim',[0 -360])
set(AX(2),'YTick',[0:-60:-360])
命令回覆錯誤為
Error using ==> set
Bad property value found.
Object Name : axes
Property Name : 'YLim'
Values must be increasing and non-NaN.
我在想是不是因為我plotyy把4張圖放一起,所以不能用set
請問各位大大,我要怎麼調整"y軸範圍呢?"
謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 36.224.11.30
1F:推 ckshfire:[-360 0] 01/05 19:02
2F:→ s0310388:謝謝ckshfire的回應,已解決 01/05 22:38
3F:→ s0310388:但右邊y軸尺度數字會消失,要改為 01/05 22:39
4F:→ s0310388:set(AX(2),'YTick',[0:60:-360]) 01/05 22:39