How to create a geographic colormap of the world using lat lon data?
29 views (last 30 days)
I am quiet familiar with MATLAB since 3 years. I want to create a geographic colormap from some data (data matrix looks like this, longitude, latitude, data). How can I do that with MATLAB?
I have used some matlab code to do it, however matlab only plots the lat lon data, however it can't plot them in the continuous scale, thus the figure looks bad as compared to GMT/ NCL.
I am attaching the code below .
This is the figure which I got.
I have tried to plot that with Genereic Mapping Tools (GMT), however I want to create it using MATLAB. I am attaching the GMT created figure for your reference below. The figure is created using Robinson Map Projection.
This is the figure I want to create.
Please someone help me to solve this. Thank you very much.
N.B. -- Please don't suggest GMT+ MATLAB built in setup, beacause I am using a Windows system, where GMT isn't supportable.
ANKUR KUMAR on 11 Jul 2021
You can simply use the contour or contourf or imagesc function to do that.
Let us start with the random data.
Let us take satellite data to plot the data on map. I am taking TRMM precipitation data as a sample:
filename='trmm_sample_data.txt'; % Attached
% This is a netcdf file, but I have replaced the file extension from .nc to .txt file
% in order to attach .nc file here in the answers.
axis([75 90 15 25])
If you have the shapefile of caostlines, or state bundaries, you can load it using shaperead.