cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
peterj
Level III

Plotting a line for only one variable

I have a data set in which I would like one column of data to be displayed as a line, and the other displayed as points only so I can determine where the points plot relative to my line. I know can shift one of the variables to a second y axis and get the plot I want, but if one y-axis is manipulated, the second does not move. Based off other posts it doesn't look like scripting in JMP 9 allows for detecting a change in the axis so it would be hard, or impossible to solve through a dynamic plot.

Is there any way to lock the two y-axis scales together? Is there some other trick that I could use to create a plot as described.

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Plotting a line for only one variable

I think graph builder can do what you're after. If you drag two variables together to the Y field you can via the contextual menues (right-click) add both a line and points and then set which variable that goes with each graph type.

A script example:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

Graph Builder(

          Variables( X( :name ), Y( :height ), Y( :weight, Position( 1 ) ) ),

          Elements(

                    Points( X, Y( 1 )),

                    Line( X, Y( 2 ) )

          )

)

View solution in original post

4 REPLIES 4
ms
Super User (Alumni) ms
Super User (Alumni)

Plotting a line for only one variable

I think graph builder can do what you're after. If you drag two variables together to the Y field you can via the contextual menues (right-click) add both a line and points and then set which variable that goes with each graph type.

A script example:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

Graph Builder(

          Variables( X( :name ), Y( :height ), Y( :weight, Position( 1 ) ) ),

          Elements(

                    Points( X, Y( 1 )),

                    Line( X, Y( 2 ) )

          )

)

peterj
Level III

Plotting a line for only one variable

This is exactly what I was looking for. Thanks!

laural
Level I

Plotting a line for only one variable

It sounds like the data from the two columns is on the same exact scale.  If this is true, you might find it easier to stack the two columns.  Then you can easily plot all the data, color coding by the "Column 1" data and the "Column 2" data.  And you can easily exclude but not hide the "Column 2" data when you fit a line. 

Of course I am suggesting that this be done from the Fit Y by X platform.

peterj
Level III

Plotting a line for only one variable

This method works too, and I hadn't thought of it. The drawback for me is sometimes I have a multi segment line that I want plotted as straight segments and not a fitted approximation. I suppose I could make several series with it to get around that. Thanks!.