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
Lavik17
Level II

Plotting multiple short lines using only points and slopes

Hi everyone,

I was wondering if there is a way to use a dataset of X,Y and slope values to and plot these on a single graph? Ideally it should also do this by group.

e.g.:

Group. X.  Y.  Slope

A.         1.  1.  2

A.         2.  2.  3

B.         3.  3.  4

 

The graph will show each of these points, with a slope around it, and the line should be half the distance to the previous and next point in the dataset.

Thank you!!

3 REPLIES 3
txnelson
Super User

Re: Plotting multiple short lines using only points and slopes

A Graph Box() Display Object can handle this.  A script will have to be written to draw the lines, but it wouldn't be a difficult piece of code.

Take a look at the Graph Box() documentation in the Scripting Guide.

Jim
Byron_JMP
Staff

Re: Plotting multiple short lines using only points and slopes

I did something like that where I wanted the g-force vector plotted for every location along a race track.

 

To get the lines, I added a customize script to the graph like this:

 

Pen Size( 1 );
For Each Row(
	Line(
		{:NGPSLongitude, :NGPSLatitude},
		{:NGPSLongitude + :gLong / 2000, :NGPSLatitude + :gLat / 2000}
	)
);

 

Screen Shot 2022-12-12 at 11.27.16 AM.png

 

 

I've attached the data file below. The first script (bubble plot 3) has the figure above.

 

JMP Systems Engineer, Health and Life Sciences (Pharma)

Re: Plotting multiple short lines using only points and slopes

Except for me not understanding what you mean by the lines being " half the distance...", another way to do this would be to create 2 new formula columns to find one more X and Y point, then do some table stacking and splitting to create graphs for each group, basically just fitting a line to each of the (now) 2 data points. I've attached a workflow (for which you need JMP 17) to demonstrate this. If you need the script, let me know, and I'll send it along. Output below:

Jed_Campbell_2-1670881678949.png