how to set NaN values red in a figure ?

2 visualizaciones (últimos 30 días)
BN
BN el 14 de Oct. de 2019
Respondida: dpb el 14 de Oct. de 2019
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)')

Respuesta aceptada

dpb
dpb el 14 de Oct. de 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...

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by