cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
scott1588
Level IV

Formula plot in graph builder

I performed a curve fit in JMP and saved the formula to a column (see below). I would like to be able to have the same curve appear in Graph Builder.

 

JMP Flare Curves.png

 I have tried to use Customize>Script to add the saved formula as a Y Function but nothing happens. See below.

 

scott1588_0-1710289650510.png

I'm sure I'm making some kind of simple error but I'm stuck at this point.

Any suggestions?

Thanks in advance for any help.

3 ACCEPTED SOLUTIONS

Accepted Solutions
scott1588
Level IV

Re: Formula plot in graph builder

Figured it out. I can add the formula to Custom>Script, but I have to change the column name to x.

View solution in original post

Re: Formula plot in graph builder

Here is a step-by-step solution.

  1. Drag the predictor data column to the X role.
  2. Drag the response data column to the Y role.
    scatter.JPG
  3. Drag the formula data column to the right of the Y role inside the frame.
    drag formula.JPG
  4. Right-click in the frame and select Points > Y > (formula data column) to remove the markers for the formula.
    minus points I.JPG
  5. Right-click in the frame and select Smoother > Y > (response data column) to remove the markers for the data.
    minus smoother.JPG

View solution in original post

scott1588
Level IV

Re: Formula plot in graph builder

Well... I'm an idiot. It turns out that I have two similarly named predictor columns. I used one to generate the curve fit equation but I inadvertently used the other on the X axis for graph builder. Once I corrected this, the Formula Graphics element worked like a charm.

 

Aaargh.

 

Thanks for all your help. The incredible support from the JMP staff and community are a HUGE reason why we use JMP.

View solution in original post

9 REPLIES 9
pmroz
Super User

Re: Formula plot in graph builder

Add a formula column to your data table, using your function.  Then add that column to the graph as a function.  Here's an example with a simple linear regression

dt = New Table( "Test Linear Regression", Add Rows( 6 ),
	New Column( "Column 1", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4, 5, 6] ) ),
	New Column( "Column 2", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [1, 3, 2, 4, 3, 7] ) ),
	New Column( "Column 3", Numeric, "Continuous", Format( "Best", 12 ),
		Formula( 0.1333333 + 0.9142857 * :Column 1 ) )
);

gb = dt << Graph Builder(
	Size( 522, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :Column 1 ), Y( :Column 2 ), Y( :Column 3, Position( 1 ) ) ),
	Elements(
		Formula( X, Y( 2 ), Legend( 12 ) ),
		Points( X, Y( 1 ), Legend( 13 ) )
	),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model( 12,
				Properties( 0, {Line Color( 19 )}, Item ID( "Column 3", 1 ) )
			)}
		)
	)
);

pmroz_0-1710295424410.png

Here's the formula column:

pmroz_2-1710295488932.png

 

pmroz_1-1710295449491.png

 

scott1588
Level IV

Re: Formula plot in graph builder

So... First, thanks for the reply.

 

I have the formula column but I'm not sure how to add it to the graph as a function. I don't really know JSL that well. Can I do this without using JSL?

scott1588
Level IV

Re: Formula plot in graph builder

Figured it out. I can add the formula to Custom>Script, but I have to change the column name to x.

Re: Formula plot in graph builder

Graph Builder provides the Formula graphics element. It is based on a data column formula. Please see the

https://www.jmp.com/support/help/en/17.0/#page/jmp/formula.shtml

.

scott1588
Level IV

Re: Formula plot in graph builder

Hi Mark,

 

Thanks for your reply.

 

As a matter of fact, I looked at that exact page before my post. I must not understand the process properly because it is not working for me. When I drag the formula to the Y axis with the individual values on the X axis Graph builder just plots individual data points for the function, not a smooth curve. See attached image. The Legend shows a line but there is no line.

 

I'm not sure what I'm doing wrong here.

 

scott1588_0-1710345776363.png

 

 

 

 

 

Re: Formula plot in graph builder

You seem to be plotting the data, not the formula. Try this: drag the predictor data column to the X role, drag the response data column to the Y role, and then drag the formula data column just to the right of the Y role (inside the frame and close to the left border). JMP should preview the result until you release the mouse button. You should see the formula added to the markers.

Re: Formula plot in graph builder

Here is a step-by-step solution.

  1. Drag the predictor data column to the X role.
  2. Drag the response data column to the Y role.
    scatter.JPG
  3. Drag the formula data column to the right of the Y role inside the frame.
    drag formula.JPG
  4. Right-click in the frame and select Points > Y > (formula data column) to remove the markers for the formula.
    minus points I.JPG
  5. Right-click in the frame and select Smoother > Y > (response data column) to remove the markers for the data.
    minus smoother.JPG
scott1588
Level IV

Re: Formula plot in graph builder

Well... I'm an idiot. It turns out that I have two similarly named predictor columns. I used one to generate the curve fit equation but I inadvertently used the other on the X axis for graph builder. Once I corrected this, the Formula Graphics element worked like a charm.

 

Aaargh.

 

Thanks for all your help. The incredible support from the JMP staff and community are a HUGE reason why we use JMP.

hogi
Level XII

Re: Formula plot in graph builder

To switch from point plot to any other plot type - like Formula - just click on the icon on top of the plot region:

hogi_0-1710352556441.png


if the icons are missing, you can show them again by activating "Show Control Panel" from the Graph builder RedTriangle Menu:

hogi_1-1710352592382.png