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
XanGregg
Staff
Vector Plots in JMP

 

Vector plots show arrows on a two-dimensional plot and allow one to see four dimensions of data: x position, y position, arrow angle, and arrow length. Equivalently, the four dimensions can be x start position, y start position, x end position, and y end position. The latter form is most convenient for JMP. Though JMP doesn't have a menu command to create vector plots, arrows can be added to almost any plot without much trouble.

 

 

While lots of four-variable data sets can be adapted for vector display, I'll demonstrate with one of the most natural applications: wind data. This data set records wind speed and direction for various weather stations in the Chicago area. I used formulas to convert the speed and direction into end positions for the arrows and then added the following graphics script to a bivariate scatterplot using Customize from the graph's right-click menu.

Bivariate(
	Y( :Lat1 ),
	X( :Lon1 ),
	Show Points( 0 ),
	SendToReport(
		Dispatch( {}, "1", ScaleBox, {Min( -90.9505699180481 )} ),
		Dispatch( {}, "2", ScaleBox, {Min( 38.9936726055607 ), Max( 44.9620694317012 ), Minor Ticks( 0 )} ),
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Frame Size( 501, 429 ), Add Graphics Script(
				1,
				Description( "Script" ),
				Pen Size( 2 );
				For Each Row( Arrow( {lon1, lat1}, {lon2, lat2} ) );
			), Grid Line Order( 3 ), Reference Line Order( 2 )}
		)
	)
)

Here's a screen capture showing a little bit of the data table, graph, and customize dialog:WindcaptureWindcapture

The next steps were to delete the rows with no wind and to turn off the points in the graph.

 

To provide context, I added the map of weather stations provided by the weather service. Placing a image in a graph is a bit tricky (and could be the subject of another post). There are two options: Draw the picture in another custom graphics script, or drag and drop an existing image into the graph. I chose the latter since I had an image file. First, I sized the graph to be the same size as the image, and then I dragged the image file into the center of the graph. After a few tries, the alignment was pretty good. (BTW, we're working on making this better in JMP 9.)Wind May31Wind May31

 

The plot shows relative wind readings taken at 6 p.m. on May 31, 2009. With the help of the background image, we can see how wind patterns vary in relation to Lake Michigan.

 

The data file, with scripts, is available in the File ExchangeChicago Wind Data and Plot 

 

 

Source of data and image: the National Severe Storms Laboratory Historical Weather Data Archives, Norman, Oklahoma.

 

 

 

Last Modified: Mar 18, 2024 12:59 AM
Comments