matlab,縱座標向下指
- 2022-08-22
很簡單如圖:在你繪製的圖上的Veiw的下拉選單中找到Figure palette項,並雙擊,找到對應的Y軸,Reverse項劃勾就行了!
需要用程式碼控制,編輯那裡只能編輯左邊的y軸
例如:
x = 0:0。01:20;
y1 = 200*exp(-0。05*x)。*sin(x);
y2 = 0。8*exp(-0。5*x)。*sin(10*x);
[ax,h1,h2] = plotyy(x,y1,x,y2,‘plot’);%得到ax軸控制代碼與第一圖y1,的h1控制代碼,第2圖y2,的h2控制代碼
set(get(ax(1),‘ylabel’),‘string’,‘slow decay’) %設定左側y軸的標籤
set(get(ax(2),‘ylabel’),‘string’,‘fast decay’) %設定右側y軸的標籤
xlabel(‘time (\musec)’)%x軸的標籤
title(‘multiple decay rates’)
set(h1,‘linestyle’,‘——’)%對應第一條曲線的線性y1
set(h2,‘linestyle’,‘:’)%對應第一條曲線的線性y2
加一句
axis ij