3D plot of Latitude, Longitude and Depth while the colour of the points represent earthquake magnitude
10 views (last 30 days)
Show older comments
I have been able to plot the points using scatter3 but I am struggling on making the colour of the points represent the earthquake magnitude. I am using an excel file with the following columns 'lat', 'long', 'depth' and 'mag'. I have 2461 earthquakes to plot therefore it is a 2461x4 table. Below is the code I have used to plot the points and I have attached a screenshot of what I get when I run the code. I have also attached a screenshot called "Desired_Result" which is what I would like the final product to look like. I do not have much MATLAB experience so any help you can provide would be greatly appreciated! Thank you!
eqs = readtable('India.xlsx');
%Defining Variables
lat = table2array(eqs(:,1));
long = table2array(eqs(:,2));
Depth = table2array(eqs(:,3));
Mag = table2array(eqs(:,4));
%plot
scatter3(long,lat,Depth)
%reversing the z axis
set(gca,'ZDir','reverse')
%Labels
ylabel('Latitude')
xlabel('Longitude')
zlabel('Depth(km)')
Title('Himalaya Earthquakes')
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Seismology in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!