0
votes

I am using MATLAB R2015a. I have defined a grid which is basically a matrix that stores the latitudes of the grid points in the first column and the longitudes of the grid points in the second column I have some data for energy of an earthquake for a region stored in a column vector where each element corresponds to the energy at the corresponding grid point. I have done a surface plot using this code (here e_lat and e_long are the first and second columns of the grid matrix respectively):-

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

This is an example (the actual data that I am processing):-

cumulative_plot(b_corr,e_lat,e_long,1,20);

I want to make a contour plot of this energy data on a geographic map of the region specified. Is this possible?

To give a better idea, this is what I have right now :-

And this is kind of what I want to achieve (without the purple circular markers and other things. Just the base energy) :-

IMG_20170228_173241_HDR (1).jpg

1
Oh I see, I deleted my answer because I see how it didn't answer your question. For what you want I think you could check the mapping toolbox mathworks.com/help/map/index.html , but I don't have it, so I can't help you further, sorry.Noel Segura Meraz
Sure, thanks. This plot has been done in GMT after processing the data in matlab. I wanted to do the whole work in matlab. Sadly my supervisor won't give me extra time to learn the toolbox.Archon
I was thinking on your problem and it might be possible make such a plot without the mapping toolbox if you provide with the topological data to plot. Or know a service that can provide this information easily in a Matlab readable format.Noel Segura Meraz
Yes that is a good ideaArchon

1 Answers

0
votes

If you have the bmp image of the mountain details, save the data in RGB format, and mix it with the data of the cumulative energy scale by its intensity. Intensity provide the alpha blending value.