我正在使用MATLAB R2015a。我已經定義了一個網格,該網格基本上是一個矩陣,用於存儲第一列中網格點的緯度,而第二列中的網格點的經度我有一些用於存儲在列向量中的地區的地震能量的數據其中每個元素對應於相應網格點處的能量。我已經做了使用此代碼的表面圖(這裏e_lat和e_long分別是網格矩陣的第一和第二列): -在matlab中繪製數據地圖
function [b] = cumulative_plot(beam, e_lat,e_long, t_start, t_end)
%CUMULATIVE_PLOT Plots the cumulative energy of the earthquake
%% Input Arguments
% *beam* - Energy for each time increment (columns) for each grid point (rows)
%
% *e_lat* - Vector containing Latitudes of the grid points
%
% *e_long* - Vector containing Longitudes of the grid points
%
% *t_start* - starting time
%
% *t_end* - ending time
%
% *t_start* and *t_end* define the time window within which the energy is
% to be considered
%% Code
b = [];
b = sum(beam(:,t_start:t_end)')'; % Adding the energy within the time window
b = b./max(b); % Normalising
fn = 'cumulative_energy.txt';
f = fopen(fn,'w');
for i=1:length(e_lat)
fprintf(f,'%f %f %f \n',e_long(i),e_lat(i),b(i));
end
fclose(f);
energy_surf = fit([e_long,e_lat],b, 'loess');
plot(energy_surf,'style','contour');
hold on;
plot3(73.6400 ,34.5239 ,20,'s','MarkerSize',20,'MarkerEdgeColor','k','MarkerFaceColor','k')
hold on;
plot3(94.709,23.03,20,'s','MarkerSize',20,'MarkerEdgeColor','b','MarkerFaceColor','b')
shading interp
alpha(1)
view(0,90)
box off
colorbar
title(['Cumu Energy(0.05 - 0.2 Hz) at seconds = ' num2str(t_start)],'FontWeight','bold','FontSize',15,'FontName','Times');
xlabel('Long/degree','FontWeight','bold','FontSize',13,'FontName','Times');
ylabel('Lat/degree','FontWeight','bold','FontSize',13,'FontName','Times');
end
這是一個示例(即我處理的實際數據): -
cumulative_plot(b_corr,e_lat,e_long,1,20);
我想在指定區域的地理地圖上繪製此能量數據的等高線圖。這可能嗎?
這是什麼樣的我想要實現(沒有紫色圓形標記和其他的東西就在基地的能量。) : -
哦,我明白了,我刪除了我的答案,因爲我看到它沒有回答你的問題。對於你想要的,我想你可以檢查映射工具箱https://www.mathworks.com/help/map/index.html,但我沒有它,所以我不能幫你進一步,對不起。 –
當然,謝謝。在matlab中處理數據後,這個圖已經在GMT完成了。我想在matlab中完成整個工作。可悲的是,我的主管不會給我額外的時間來學習工具箱。 – Archon
我在考慮你的問題,如果你提供拓撲數據進行繪圖,可能會在沒有繪圖工具箱的情況下製作這樣的繪圖。或者瞭解一種能夠以Matlab可讀格式輕鬆提供這些信息的服務。 –