how to set NaN values red in a figure ?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, How to set all NaN values red color in the code below? ( I want to see NaN part as red color in output)
Mean_precip= nanmean(new_precipitation, 3); % average of all months
surf(loni, lati, Mean_precip(:,:,:).'); view(2)
axis xy
[Loni2,Lati2] = meshgrid(loni,lati);
%shading interp
cmocean 'rain' % rainy to dry colormap
xlabel longitude
ylabel latitude
[Lati2,Loni2,newpreceip,Mean_precip] = recenter(Lati2,Loni2,newpreceip,Mean_precip);
hold on
borders('countries','color',rgb('dark gray'))
cmocean 'rain'
cb = colorbar;
cb.Label.String = 'Average Precipitation (mm/m)';
xlabel longitude
ylabel latitude
title ('Precipitation (Monthly Average from 1982 to 2015)')
0 件のコメント
採用された回答
dpb
2019 年 10 月 14 日
I guess you could interpolate to fill in the NaN locations and then scatter3 them on top of the surf w/ the red marker...otherwise, what value would you use to plot with?
W/O a dataset to play with, it's hard to visualize just what is going to happen here...or what you have in mind the result should look like...
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で NetCDF についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!