3D plot of Latitude, Longitude and Depth while the colour of the points represent earthquake magnitude
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michelle Pearce
le 2 Août 2022
Commenté : Michelle Pearce
le 2 Août 2022
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 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Earthquake Engineering dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!