How to plot humidity data on a world map?

5 views (last 30 days)
Hi there,
I have average humidity data as well as longitude and latitude data from the corresponding weather stations. I'm relatively new to MatLab and would like to know how would I go about creating a colour map of this data?
Best regards,
Frank

Answers (1)

Nathan Hardenberg
Nathan Hardenberg on 20 Jul 2023
An easy way would be to use geoscatter(). This does not interpolate but just plots the points with color according to the value.
lon = -1*[165, 155, 155, 140, 132, 140, 145, 180, 165]; % data
lat = [55, 60, 70, 67, 62, 60, 70, 52, 65];
data = [3, 1, 5, 2, 0.5, 3, 4, 0, 1];
figure(1);
markerSize=1000;
geoscatter(lat, lon, markerSize, data, '.') % plot points
colormap(jet) % choose colormap
colorbar % show colorbar in figure
If you want to interpolate the data (get values in between), the problem gets quite a bit harder. There are ways to interpolate which are for example shown here:
and I also gave it a shot here:
The problem is that this interpolates in 2D and not on the earth (a spherical surface). For smaller regions that is good enough, but if you have the whole world for example this does not work anymore.
Sadly I did not find any easy solution for this problem

Categories

Find more on Weather and Atmospheric Science 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!