我有以下腳本MATLAB改變ylabel的值作爲深度
clear all; clc;close all;
dx = 0:100:400 % in meters
rho_30 = [ 33.2185 33.3202 33.4763 33.5851 33.6078];
rho_50 = [ 58.4567 58.1212 57.5382 56.8300 56.0449];
rho_70 = [76.1825 76.0842 75.9825 75.9252 75.9507];
plot(dx,rho_30, 'r', 'LineWidth', 2) % rho at depth = 30 meters
hold on
plot(dx,rho_50, 'b', 'LineWidth', 2) % rho at depth = 50 meters
hold on
plot(dx,rho_70, 'g', 'LineWidth', 2) % rho at depth = 70 meters
grid on
legend('rho at depth = 30m', 'rho at depth = 50m', 'rho at depth = 70m')
xlabel('length of channel (meters)'); ylabel('depth(meters)')
正如你可以從圖中看到,深度從80米在表面開始直到30米在底部。
我的問題:如何更改深度應該從-30開始在 表面,直到-80米,底部或ylabel應該從-30開始 至-80
你的意思是'xticks'和'xticklabels'?或標籤本身? –
ylabel應該是-30在表面和-80在底部,同時rho_30(紅色)應該放在頂部,rho_50(藍色)中部和rho_70(綠色)在底部。 – User1961
爲什麼不把'rho_30','-rho_50'和'-rho_70'而不是'rho_30','rho_50'和'rho_70'繪圖? –