MATLAB Answers


Plotting Latitude, Longitude and a variable

Asked by MatLab Code N on 20 May 2019
Latest activity Commented on by MatLab Code N on 21 May 2019
Accepted Answer by KSSV
Hi, I have three columns (latitude, Longitude and X). I want a plot with latitude as x axis, Longitude as Y axis and the corresponding value of X in the main plot. X has to be colored using gradiant of value of X to get a hsv color.
Sample data attached!!


Sign in to comment.


1 Answer

Answer by KSSV
on 21 May 2019
 Accepted Answer

[num,txt,raw] = xlsread('sample_data.xlsx') ;
lat = num(:,1) ;
lon = num(:,2) ;
z = num(:,3) ;
z(z>500) = NaN ;
scatter(lon,lat, 40, z, 'filled');

  1 Comment

Thanks! Worked perfect.

Sign in to comment.