3D plot of Latitude, Longitude and Depth while the colour of the points represent earthquake magnitude
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Michelle Pearce
el 2 de Ag. de 2022
Comentada: Michelle Pearce
el 2 de Ag. de 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 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Earthquake Engineering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!