我正在使用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可读格式轻松提供这些信息的服务。 –