Unable to add coastlines to SST plot

11 ビュー (過去 30 日間)
Arnav Gupta
Arnav Gupta 2022 年 5 月 30 日
コメント済み: Chunru 2022 年 6 月 2 日
Im currently using MATLAB R2022a and trying to add coastlines to my SST plot.I have tried everything load coast, load coastlines, coast.mat but not working. The file just not exists , please tell me how to add coastlines to my plot.
  1 件のコメント
MJFcoNaN
MJFcoNaN 2022 年 5 月 31 日
Hello, you should post your code and a sample of data.
There are many toolbox or built-in function to do it.

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

採用された回答

Chunru
Chunru 2022 年 6 月 2 日
編集済み: Chunru 2022 年 6 月 2 日
unzip('sst_data.zip')
%dir
filename="sst_data.cdf";
%ncdisp(filename);
long=ncread(filename,'COADSX');
lat=ncread(filename,'COADSY');
sst=ncread(filename,'SST');
sst_march=sst(:,:,3:3);
imagesc(long,lat,sst_march')
colorbar
load coastlines
hold on
%borders
plot(wrapTo360(coastlon), coastlat, 'r.', 'MarkerSize', 2);
axis xy
  2 件のコメント
Chunru
Chunru 2022 年 6 月 2 日
When you "load coastlines", you read in variable coastlon and coastlat. The variable coastlon has range from -180 to 180 deg while the netcdf you have lon range from 0 to 360 deg. So you need to wrap around the lon data.
Chunru
Chunru 2022 年 6 月 2 日
You are haveing the whole world map (check out the range of lon and lat) and you can just zoom into any part in the plot. The coastlines data (default in matlab) is of coarse resolution. Note also that coast lines only specify the coast lines and it does not give the country boundaries. For showing country boundaries, you need to read other map data.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by