Colour gradient based on 3rd variable for geoshow points

So I have a script which puts points at each location for earthquakes based on a data set which amongst other things has data for lat, lon and magnitude. I used the latitude and longitude to plot the points but I want to have the colour of the points be on a gradient from red to blue as the magnitude goes from 7.5 to 2.5 so I can show where the biggest earthquakes happen. Here is my code so far:
%Import data from csv file
ds = datastore('earthquakesWWJan-Apr2019.csv','TextType','string');
ds.SelectedVariableNames = {'time','latitude','longitude','depth','mag','place','type',...
'horizontalError','depthError','magError','dmin'};
data = readall(ds);
%create map
figure
geoshow('landareas.shp');
%add point for each earthquake on top of map
hold on;
geoshow(quakes.latitude, quakes.longitude, 'Color', 'red', 'MarkerEdgeColor', 'auto', 'Marker', '.', 'MarkerSize', 10, 'DisplayType', 'point')
hold off;
xlabel('Longitude');
ylabel('Latitude');
I want to make the colour a variable which changes depending on the quakes.mag value that matches up for the point.
Hopefully you can decipher this and help.

 採用された回答

KSSV
KSSV 2020 年 7 月 15 日

0 投票

2 件のコメント

Image Analyst
Image Analyst 2020 年 7 月 15 日
And attach 'earthquakesWWJan-Apr2019.csv' and a screenshot if you want more help.
Callum McCreath
Callum McCreath 2020 年 7 月 15 日
Scatter worked fine, got the colours working thanks for the help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGeodesy and Mapping についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by