Graphbox equivalent to GraphBuilder codeHi 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?
Automation and ScriptingRe: Graphbox equivalent to GraphBuilder codeIs 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;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.

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.