フィルターのクリア

Plot air temperature data on pressure levels (Hovmöller diagram).

10 ビュー (過去 30 日間)
khan
khan 2018 年 6 月 3 日
回答済み: kafhi bachrudin 2023 年 5 月 29 日
Hi, i need to plot air temperature at certain pressure levels. For reference a netcdf sample file is attached.
I want the data to be plotted for a certain latitude suppose (55) and a certain Longitude range suppose (60-90), and pressure levels suppose (1-17). In this case the X-axis will denote the Longitude range while Y-axis will show the pressure levels.
Any help will be appreciated.
  3 件のコメント
khan
khan 2018 年 6 月 4 日
Sir, i think what you did is right, can you please share the procedure so i can see the steps and use. This data is Air temperature anomalies with unit of Kelvin. Thank You for helping
jonas
jonas 2018 年 6 月 4 日
Done! Didn't want to post an answer before it was correct. Happy to help.

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

採用された回答

jonas
jonas 2018 年 6 月 4 日
編集済み: jonas 2018 年 6 月 4 日
Here you go! Note that you specify the latitude and range of longitudes as the indices of their respective vectors, and not in units of degrees. You can easily try other types of plots (like controuf) or change the colormap.
ncid = netcdf.open('amj_w.nc','NOWRITE')
ncdisp('amj_w.nc');
lon = ncread('amj_w.nc','longitude');
lat = ncread('amj_w.nc','latitude');
p = ncread('amj_w.nc','level');
T = ncread('amj_w.nc','t');
lat_const=50; %the latitude as the index in the lat vector
range=1:100; %specify the lon range as index...
T=permute(T,[3 1 2]);
surf(lon(range),p,T(:,range,lat_const),'edgecolor','none');
cb=colorbar;
cb.Label.String='Temperature / K';
xlabel('longitude / degrees east')
ylabel('pressure / millibars')
set(gca,'XLim',[lon(min(range)) lon(max(range))])
view([0 90])
box on
title(['Latitude: ',num2str(lat(lat_const)),' degrees'])
set(gca,'layer','top')
colormap(parula)
  8 件のコメント
Tanziha Mahjabin
Tanziha Mahjabin 2020 年 3 月 12 日
I found my problem. when i was plotting lon vs time, i was not having latitude constant.
It works fine now. Thank you
jonas
jonas 2020 年 3 月 12 日
Great, no problem! I recommend using the datetime class instead of the old buggy datenum

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

その他の回答 (1 件)

kafhi bachrudin
kafhi bachrudin 2023 年 5 月 29 日
hello sir i have a question how to find latitude constant ?

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by