how to set NaN values red in a figure ?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
dpb
le 14 Oct 2019
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur NetCDF dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!