% test shade_nan

close all
clear all
x = -1:.1:1;
y = -1.5:.1:1.5;
[xx, yy] = meshgrid(x, y);
z = peaks(xx, yy);
z(1:4, 3:5) = repmat(NaN, 4, 3);
z(8,9) = NaN;
z(7:12, 4) = repmat(NaN, 6, 1);
z(7:10, 12:14) = repmat(NaN, 4, 3);
z(12, 1) = NaN;
z(12:14, end) = repmat(NaN, 3, 1);
contourf(x, y, z)

figure
contourf(x, y, z)
shade_color = [.8 .8 .8];

shade_nan(x, y, z, shade_color)

figure
x = xx;
y = yy;
contourf(x, y, z)
shade_color = [1 0 0];

shade_nan(x, y, z, shade_color)
