Polar plot - plot as a line joining the points rather than like a compass plot

2 vues (au cours des 30 derniers jours)
Jenny
Jenny le 10 Mai 2016
I have a polar plot that looks like a compass plot. The data that is plotted is in the attached file where the data is in columns as follows:
Direction Max Mean Count %TotalFlow.
To plot the data I use the following code:
%%Import data from spreadsheet
disp('Select the Max_mean_count_TotFlow_per24Dir data file to import');
[filename,pathname]=uigetfile('*.xlsx','Select the file');
data = xlsread(fullfile(pathname,filename));
% Allocate imported array to column variable names
Dir = data(:,1);
Max = data(:,2);
Mean = data(:,3);
Count = data(:,4);
TotFlow = data(:,5);
Depth = input(['Input the depth for ',filename,': '],'s');
ColourDepth='[0 0.400000005960464 0.800000011920929]';
%%Max
plotdata = Max;
A=sortrows([Dir,plotdata]); % sorts into ascending order
Dir=A(:,1).*pi./180; % converts to radians from degrees
plotdata=A(:,2);
%New=[];
New=[plotdata';plotdata'];
New=New(:);
% plot the data
figure1 = figure('PaperSize',[20.98404194812 29.67743169791]);
[t,r]=rose(Dir,720);
ind=find(r);
r(ind)=r(ind).*New';
p = polar(t,r);
view([90 -90])
set(p,'color',ColourDepth);
ph = allchild(gca);
set(ph(end),'FaceColor','none');
The code works and I get a plot that looks like a compass plot with a line from 0 - out to the data point for each direction (attached figure PolarMax.png).
I would like the plot to look like the figure in PolarMax_Test.zip where there is a line joining the data points for each direction.
any help to achieve this would be greatly appreciated.
Jenny

Réponses (0)

Catégories

En savoir plus sur Polar Plots dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by