MATLAB: How to display contour data in polar coordinates onto a polar chart

MATLAB

I have angle and distance data (A*pi/180,R), where A is angle data in degrees and R is radial distance data between 0 and 10. At each of these points corresponds a magnitude Z. I have plotted contour data in cartesian coordinates with the angle A in the X-axis and the radial distance R in the Y-axis. I want to plot contours of Z onto a polar chart. However, when using POLAR in conjucntion woth CONTOUR, I do not get the right result.

Best Answer

The ability to display contour data in polar coordinates is not directly available in MATLAB.
However, the following code allows you to display contour data in polar coordinates onto a cartesian chart:
load PolarContourData; % This file is attached.
h=polar([0 2*pi],[0 10]);delete(h); %Create a polar axes and delete the line specified by POLAR
hold on;
[theta, rho] = meshgrid(A*pi/180, R);
[X, Y] = pol2cart(theta, rho);
contour(X, Y,Z,4) %Create contour plots in polar coordinates onto polar chart
set(gca,'visible','off'); % Set the axes to invisible in order for hte polar patches to appear.
Related Question