Subscribe Bookmark RSS Feed

Plotting a line for only one variable

peterj

Community Trekker

Joined:

Jun 23, 2011

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
Solution

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 ) )

          )

)

4 REPLIES
Solution

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

Community Trekker

Joined:

Jun 23, 2011

This is exactly what I was looking for. Thanks!

laural

Community Trekker

Joined:

Jun 23, 2011

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

Community Trekker

Joined:

Jun 23, 2011

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!.