MATLAB: How to do Polar plot

polarplot

Hi all,
Thank you for the help in advance. I wanted to plot the data usin' polar plot as the exmple shows https://matplotlib.org/examples/api/radar_chart.html
the vectors are attached as: theta=TSP rho=DNA trajectories= the direction of the wind
any help would be truly appreciated.

Best Answer

If you want to create a polar plot, use the polarplot function introduced in release R2016a. It doesn't look exactly like the spider plot in the link Honglei posted, but it can look close, and it looks like some of the results in a Google Images search for "radar plot".
% Generate sample data
r = rand(1, 16);
th = linspace(0, 2*pi, length(r));
% Create the polar plot and get the handle to the axes
h = polarplot(th, r);
ax = ancestor(h, 'polaraxes');
% Use the axes handle to manipulate the ticks and tick labels
ax.ThetaTick = rad2deg(th);
ax.ThetaTickLabel = arrayfun(@(x) char(x+'A'), 0:15, 'UniformOutput', false);
I chose to use 'A' through 'O' as the tick labels because it was easy, but you could use a cell array containing your own names.