MATLAB: To create Polar Shaded plot

polar shaded plot

X,Y,Z DATA ..all n*1 array
X is angle, with NEWS convention, Y is radius, Z is data.
I need shaded plot of data, onto a polar plot of radius information in Y angle information in X and data information in Z
Basically a rose plot sans the discreet histogram.
Sorry cant figure out any solution.

Best Answer

If you don't see a polar plot which does what you want, you can use the pol2cart function to get to any of the Cartesian techniques, such as the ones I described in this blog post.
% Made up data
npts = 200;
theta = 2*pi*rand(npts,1);
r = rand(npts,1);
v = cos(theta) .* sin(pi*r);
% Convert to cartesian
[x,y] = pol2cart(theta,r);
% Interpolate onto grid
[xg,yg] = meshgrid(linspace(-1,1,125));
F = scatteredInterpolant(x,y,v);
% Mask out extrapolation
b = boundary(x,y);
inmask = inpolygon(xg(:),yg(:), x(b),y(b));
vg = F(xg,yg);
vg(~inmask) = nan;
% Call pcolor
polar(nan,nan)
hold on
h = pcolor(xg,yg,vg);
h.EdgeColor = 'none';
colorbar