How to reshape latitude, longitude and data of not regularly-spaced vectors into 2-D matrix to plot a pcolorm?

5 ビュー (過去 30 日間)
A LL
A LL 2022 年 6 月 9 日
回答済み: Arun 2023 年 10 月 19 日
I have latitude, longitude and data vectors of size 7631 that are not equally spaced.
I want to plot a pcolorm of the data at the given latitude and longitude.
Since my data is not regularly-spaced I have a hard time being able to do a pcolorm.
I thought it would work with latitude, longitude and data as vectors but it does not work properly.
I am converting data from a x-y grid to a lat-lon grid. I want to reproduce the figure on the x-y grid below on the geo-referenced map.
% Load latitude, longitude & data
load('lat_lon_data.mat');
figure(1);
ncpolarm('lat',66); hold on;
%pcolorm(latitude,longitude,data); %NOT WORKING
Figure on my original x-y grid that I want to convert on a georeferenced map:
Georeferrenced map on which I want to do a pcolorm of my data.
Thank you

回答 (1 件)

Arun
Arun 2023 年 10 月 19 日
Hello,
I understand that you are facing difficulties to plot using “pcolorm” as the data is not regular.
“pcolorm“ is limited for plotting irregular data. “geoscatter” function helps achieve the desired result for irregular data. Here is a sample code for generating the map using the data you shared:
load('lat_lon_data.mat'); %load data
geoscatter(latitude, longitude, 50, data, 'filled'); %plot the map
geobasemap('topographic');
colorbar;
Please refer the shared MathWorks documentation link for more details: https://in.mathworks.com/help/matlab/ref/geoscatter.html
Hope this helps.

カテゴリ

Help Center および File ExchangeWeather and Atmospheric Science についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by