簡體   English   中英

在Matlab中在地圖上繪制數據

[英]Plotting data on a map in matlab

我正在使用MATLAB R2015a。 我定義了一個網格,該網格基本上是一個矩陣,用於存儲第一列中網格點的緯度和第二列中網格點的經度。對於列向量中存儲的區域,我有一些地震能量數據其中每個元素對應於相應網格點處的能量。 我已經使用此代碼完成了表面繪圖(此處e_lat和e_long分別是網格矩陣的第一和第二列):

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);

我想在指定區域的地理地圖上繪制此能量數據的輪廓圖。 這可能嗎?

為了給一個更好的主意,這就是我現在所擁有的:

這就是我想要實現的目標(沒有紫色的圓形標記和其他東西。只是基本能量):-

IMG_20170228_173241_HDR(1).jpg

如果您具有山脈細節的bmp圖像,則將數據保存為RGB格式,並按強度將其與累積能量規模的數據混合。 強度提供Alpha混合值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM