I want to know how I can change the color map and corresponding color bar to showing from light blue(#add8e6) to dark blue (#00008b).
S = shaperead ('country_Boundary.shp');lon = S.X; % for example, I want to find all points in polygon number one
lat = S.Y;plot(lon, lat, '-k')hold onaxis equalax = gca;xL = ax.XLim;yL = ax.YLim;rect_x = [-0.25 -0.25 0.25 0.25];rect_y = [0.25 -0.25 -0.25 0.25];x = points{:,1};y = points{:,2};z = points{:,3};num_colors = 100;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clrs = summer(num_colors); %<<<< here is the problem
zlim = [min(z) max(z)]+[-0.1 +0.1];clr_val = @(z) clrs(ceil(interp1(zlim, [0 1], z)*num_colors), :);for i=1:numel(x) p(i) = patch(rect_x + x(i), rect_y + y(i), ... clr_val(z(i)), ... 'EdgeColor', 'none');endax.XLim = xL;ax.YLim = yL;colorbar%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%colormap(summer)caxis([min(z) max(z)])
Thanks
Best Answer