我想繪製以下內容 - 請參見下文。如何在Matlab中繪製非常低的負值
我想使用semilogy的原因 - 或者別的什麼,也許你有什麼建議? - 數據是如此之低以至於所有的正面數據看起來都是零。
當然semilogy不適用於負數據。但我能做什麼呢?我們的目標是,正面和負面的數據在圖表中以某種方式可見,不同於零。
我看到了這個問題(Positive & Negitive Log10 Scale Y axis in Matlab),但有沒有更簡單的方法?
我在semilogy命令中遇到的另一個問題是數據被繪製爲從11月到4月,而他們確實從1月到6月!
%% Date vector
Y = [];
for year = 2008:2016
Y = vertcat(Y,[year;year]);
end
M = repmat([01;07],9,1);
D = [01];
vector = datetime(Y,M,D);
%% Data
operatingValue=...
1.0e+05 *...
[0.020080000000000, 0.000010000000000, 0.000430446606112, 0.000286376498540, 0.000013493575572, 0.000008797774209;...
0.020080000000000, 0.000020000000000, 0.000586846360023, 0.000445575962649, 0.000118642085670, 0.000105982759202;...
0.020090000000000, 0.000010000000000, 0.000304503221392, 0.000168068072591, -0.000004277640797, 0.000006977580173;...
0.020090000000000, 0.000020000000000, 0.000471819542315, 0.000318827321824, 0.000165018495621, 0.000188500216550;...
0.020100000000000, 0.000010000000000, 0.000366527395452, 0.000218539902929, 0.000032265798656, 0.000038839492621;...
0.020100000000000, 0.000020000000000, 0.000318807172600, 0.000170892065948, -0.000093830970932, -0.000096575559444;...
0.020110000000000, 0.000010000000000, 0.000341114962826, 0.000187311222835, -0.000118595282218, -0.000135188693035;...
0.020110000000000, 0.000020000000000, 0.000266317725166, 0.000128625220303, -0.000314547081599, -0.000392868178754;...
0.020120000000000, 0.000010000000000, 0.000104302824558, -0.000000079359646, -0.001817533087893, -0.002027417507676;...
0.020120000000000, 0.000020000000000, 0.000093484465168, -0.000019260661622, -0.002180826237198, -0.001955577709102;...
0.020130000000000, 0.000010000000000, 0.000052921606827, -0.000175185193313, -4.034665389612666, -4.573270848282296;...
0.020130000000000, 0.000020000000000, 0.000027218083520, -0.000167098897097, 0, 0;...
0.020140000000000, 0.000010000000000, 0.000044907412504, -0.000106127286095, -0.012248660549809, -0.010693498138601;...
0.020140000000000, 0.000020000000000, 0.000061663936450, -0.000070280400096, -0.015180683545658, -0.008942771925367;...
0.020150000000000, 0.000010000000000, 0.000029214681162, -0.000190870890021, 0, 0;...
0.020150000000000, 0.000020000000000, 0.000082672707169, -0.000031566292849, -0.003226048850797, -0.003527284081616;...
0.020160000000000, 0.000010000000000, 0.000084562787728, -0.000024916156477, -0.001438488940835, -0.000954872893879;...
0.020160000000000, 0.000020000000000, 0.000178181932848, 0.000054988621755, -0.000172520970578, -0.000139835312255]
figure;
semilogy(datenum(vector), operatingValue(:,3), '-+', datenum(vector), operatingValue(:,4), '-o',...
datenum(vector), operatingValue(:,5), '-*', datenum(vector), operatingValue(:,6), '-x',...
'LineWidth',1.2), grid on;
dateaxis('x', 12);
做一個只有正面的副圖,並且只有負面的副圖纔會翻轉,縮放到相同的xlims。 – Oleg
[在Matlab中正負號Log10標度Y軸]可能的副本(https://stackoverflow.com/questions/21027269/positive-negitive-log10-scale-y-axis-in-matlab) – Adriaan