cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
terapin
Level VI

Wind Rose for Wind Speed and Direction

 

I'm looking for a way in JMP 14 to plot a wind rose for wind speed and direction, as shown below.  Can that be accomplished currently in JMP, or is that a feature to request?  Thanks.

 

WindRose.jpg

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Wind Rose for Wind Speed and Direction

Here is a sample script that is a real rough example of how you might start

wind rose.PNG

Names Default To Here( 1 );
nw = New Window( "Example",
	Graph Box(
		FrameSize( 600, 600 ),
		suppressAxes,
		Gradient Function( b, a, b, [0, 100], Z Color( [2, 9] ) ),
		Pen Color( "black" );
		Circle(
			{50, 50},
			15,
			30,
			45/* no fill for concentric circles */
		);
		xMat = [50, 95];
		yMat = [50, 50];
		Line( xMat, yMat );
		xMat = [50, 5];
		yMat = [50, 50];
		Line( xMat, yMat );
		xMat = [50, 50];
		yMat = [50, 95];
		Line( xMat, yMat );
		xMat = [50, 50];
		yMat = [50, 5];
		Line( xMat, yMat );
		xMat = [50, 81.8198051533946];
		yMat = [50, 81.8198051533946];
		Line( xMat, yMat );
		xMat = [50, 18.1801948466054];
		yMat = [50, 81.8198051533946];
		Line( xMat, yMat );
		xMat = [50, 81.8198051533946];
		yMat = [50, 18.1801948466054];
		Line( xMat, yMat );
		xMat = [50, 18.1801948466054];
		yMat = [50, 18.1801948466054];
		Line( xMat, yMat );
		xMat = [50, 91.8];
		yMat = [50, 67.];
		Line( xMat, yMat );
		xMat = [50, 8.2];
		yMat = [50, 67.];
		Line( xMat, yMat );
		xMat = [50, 91.8];
		yMat = [50, 33.];
		Line( xMat, yMat );
		xMat = [50, 8.2];
		yMat = [50, 33.];
		Line( xMat, yMat );
		xMat = [50, 33];
		yMat = [50, 91.8];
		Line( xMat, yMat );
		xMat = [50, 33];
		yMat = [50, 8.2];
		Line( xMat, yMat );
		xMat = [50, 67];
		yMat = [50, 91.8];
		Line( xMat, yMat );
		xMat = [50, 67];
		yMat = [50, 8.2];
		Line( xMat, yMat );
		Fill Color( "cyan" );,
		Pie( 7, 93, 93, 7, 255, 285 ),
		Pie( 7, 93, 93, 7, 225, 255 ),
		Fill Color( "red" ),
		Pie( 17, 83, 83, 17, 225, 255 ),
		Text Color( "Black" ),
		Text Size( 16 ),
		Text( Center Justified, {50, 95}, "N" ),
		Text( Center Justified, {50, 1}, "S" ),
		Text( Center Justified, {3, 50}, "W" ),
		Text( Center Justified, {96, 50}, "E" )
		
	)
);
Jim

View solution in original post

Jeff_Perkinson
Community Manager Community Manager

Re: Wind Rose for Wind Speed and Direction

It looks similar to a Coxcomb plot that you can get using the Pie element in Graph Builder.

-Jeff

View solution in original post

9 REPLIES 9
txnelson
Super User

Re: Wind Rose for Wind Speed and Direction

There isn't a builtin chart that will produce the Wind Rose chart, however, a JMP Script could be written to produce such a chart.

Jim
terapin
Level VI

Re: Wind Rose for Wind Speed and Direction

Didn't think there was a builtin chart yet,

 

I'm intrigued by your JSL idea.  But, I have no idea how to get started with something like this.  Can you steer me to an JSL example of something that shows me how something like this can be accomplished?

txnelson
Super User

Re: Wind Rose for Wind Speed and Direction

Here is a sample script that is a real rough example of how you might start

wind rose.PNG

Names Default To Here( 1 );
nw = New Window( "Example",
	Graph Box(
		FrameSize( 600, 600 ),
		suppressAxes,
		Gradient Function( b, a, b, [0, 100], Z Color( [2, 9] ) ),
		Pen Color( "black" );
		Circle(
			{50, 50},
			15,
			30,
			45/* no fill for concentric circles */
		);
		xMat = [50, 95];
		yMat = [50, 50];
		Line( xMat, yMat );
		xMat = [50, 5];
		yMat = [50, 50];
		Line( xMat, yMat );
		xMat = [50, 50];
		yMat = [50, 95];
		Line( xMat, yMat );
		xMat = [50, 50];
		yMat = [50, 5];
		Line( xMat, yMat );
		xMat = [50, 81.8198051533946];
		yMat = [50, 81.8198051533946];
		Line( xMat, yMat );
		xMat = [50, 18.1801948466054];
		yMat = [50, 81.8198051533946];
		Line( xMat, yMat );
		xMat = [50, 81.8198051533946];
		yMat = [50, 18.1801948466054];
		Line( xMat, yMat );
		xMat = [50, 18.1801948466054];
		yMat = [50, 18.1801948466054];
		Line( xMat, yMat );
		xMat = [50, 91.8];
		yMat = [50, 67.];
		Line( xMat, yMat );
		xMat = [50, 8.2];
		yMat = [50, 67.];
		Line( xMat, yMat );
		xMat = [50, 91.8];
		yMat = [50, 33.];
		Line( xMat, yMat );
		xMat = [50, 8.2];
		yMat = [50, 33.];
		Line( xMat, yMat );
		xMat = [50, 33];
		yMat = [50, 91.8];
		Line( xMat, yMat );
		xMat = [50, 33];
		yMat = [50, 8.2];
		Line( xMat, yMat );
		xMat = [50, 67];
		yMat = [50, 91.8];
		Line( xMat, yMat );
		xMat = [50, 67];
		yMat = [50, 8.2];
		Line( xMat, yMat );
		Fill Color( "cyan" );,
		Pie( 7, 93, 93, 7, 255, 285 ),
		Pie( 7, 93, 93, 7, 225, 255 ),
		Fill Color( "red" ),
		Pie( 17, 83, 83, 17, 225, 255 ),
		Text Color( "Black" ),
		Text Size( 16 ),
		Text( Center Justified, {50, 95}, "N" ),
		Text( Center Justified, {50, 1}, "S" ),
		Text( Center Justified, {3, 50}, "W" ),
		Text( Center Justified, {96, 50}, "E" )
		
	)
);
Jim
terapin
Level VI

Re: Wind Rose for Wind Speed and Direction

Thanks for this great example of how to use JSL to solve the issue.  I'll start playing around with it and see how I can get it working with my data.  

steo45
Level II

Re: Wind Rose for Wind Speed and Direction

 

hello nelson,

 

 help me understand this script,

 

 where is the actual input data?  xMat/Ymat represent the wind speed or direction? 

anyway i can adapt this script to take input from a csv  file?

 

regards

Steve

txnelson
Super User

Re: Wind Rose for Wind Speed and Direction

Except for the "Pie()" functions, everything else are graphics commands to create the N, S, E, W map.  The expectation would be that one would read in the data from your JMP or Excel file, calculate required Pie() values from the input data, and then add them to the chart.  The definition of the Pie() function along with examples, can be found in the Scripting Index.  Not knowing what your data are, I cannot really guide you on what it will take to go from your input data to the parameters required for the Pie() function.

Jim
Jeff_Perkinson
Community Manager Community Manager

Re: Wind Rose for Wind Speed and Direction

It looks similar to a Coxcomb plot that you can get using the Pie element in Graph Builder.

-Jeff
terapin
Level VI

Re: Wind Rose for Wind Speed and Direction

Thanks Jeff for the suggestion,

 

I didn't realize that was an option under Pie elements.  Cool option.

 

 

I'll play around with it some to see if I can get it to display data like a Wind Rose.

 

yvesprairie
Level IV

Re: Wind Rose for Wind Speed and Direction

Let us know if you succeed, I was looking for precisely the same function a week ago!!