Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How to Import data from excel and use them to Plot windrose instead?

Example, {{Strength, Angle(degrees)}..}

data = {{11.84,24.70}, {13.64,0}, {14.11,24.70}, {11.92,16.20}, {7.95,337.10}, 
        {8.34,326.60}, {7.85,335.40}, {8.90,6.30}, {10.43,338.40}, {10.36,325.60}, 
        {10.93,332.00}, {14.78,318.20}, {14.30,345.30}};

$0$ is North.

share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

Let's say you've managed to import the data from excel and you want to transform list:

{{strength, angle}...}

so it fits the methods from the link. There are couple of operations you must do:

r = Table[{RandomReal[{0, 20}], RandomReal[{0, 360}]}, {t, 0, 15}]; (*sample data*)
  • Your list is not sorted with the angle as it need to be for proper joining the points.
  • ListPolarPlot needs to get {angle, radius}...} type of list so in the second step we are doing that.
  • last step is only in order to close the line.

r = SortBy[r, Last]; 
r = {#2 Degree, #} & @@@ r;
r = Append[r, r[[1]]];

ListPolarPlot[r, BaseStyle -> 14, Joined -> True, PlotMarkers -> Automatic,  
                 PolarGridLines -> {Range[0, 2 Pi, Pi/18], Automatic}, 
                 PolarTicks -> {"Direction", Automatic}, PolarAxes -> True, 
                 PlotStyle -> {PointSize[Large]}, PolarAxesOrigin -> {Pi/2, 20}, 
                 PlotRange -> All]

enter image description here

share|improve this answer
    
TNX. one more question: how to move lines between dots? –  StartX Oct 31 '13 at 17:22
    
@StartX I'm sorry for the delay, I was afk. What do you mean? –  Kuba Oct 31 '13 at 22:38
    
Up in example we have 16 dot's conected with line's. I don't need line's, I need only dot's. Sorry for stupid question's. –  StartX Nov 2 '13 at 19:57
    
@StartX just skip the Joined->True part :) –  Kuba Nov 2 '13 at 20:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.