cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar

Graphbox equivalent to GraphBuilder code

Hi all,
I am new to JSL. I am creating a contour plot using graph builder as follows:

out << Graph Builder(
Show Control Panel( 0 ),
Size( 1301, 847 ),
Set α Level( 0.1 ),
Variables( X( :t ), Y( :f ), Color( :p ) ),
Elements( Contour( X, Y, Legend( 2 ), Number of Levels( 10 ), Smoothness( 0.0115027054779012 ) ) )
);

What would be the equivalent code if I want to replace Graph Builder with Graph Box and t,f,p are matrices? 

2 REPLIES 2
jthi
Super User

Re: Graphbox equivalent to GraphBuilder code

Is there a specific reason for avoiding Graph Builder? You can move the contour from graph builder to graph box for example by copying and pasteing the frame contents

Names Default To Here(1); 

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

gb = dt << Graph Builder(
	Size(525, 454),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height)),
	Elements(Contour(X, Y, Legend(10)))
);
Report(gb)[FrameBox(1)] << Copy Frame Contents;

nw = New Window("",
	gbb = Graph Box(
		X Scale(55, 180),
		Y Scale(45, 75)
	)
);

gbb[FrameBox(1)] << Paste Frame Contents;
-Jarmo
txnelson
Super User

Re: Graphbox equivalent to GraphBuilder code

 

Why do you need to do this in a Graph Box?

 

Basically, the approach I would take is to run 

     Graph=>Contour

in an invisible mode, and then Save the Contours

     Save=>Save Contours

which will save the contours from the graph in an X, Y table, with each curve of the contour plot saved as a separate series of rows.  The XY data could then be read into the JSL script and processed as a Polygon in a GraphBox to generate the contour plot.

txnelson_0-1752123563227.png

 

 Things like finding the min and max XY values to set the scale of the GraphBox() will able be available from the new data table. 

Jim

Recommended Articles