cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Clanlope
Level III

[Graph Builder in JSL] how to select graph build as an object in one Lineup Box

Hi, currently I created a lineup box with several graphs like 3 in it, and after the window popped out, I want to select each the graph by xpath then do some actions like sizing or adding ref line..

However I found that I am not able to use a for loop to individually select the graphs in my lineup box, what should I do? thanks!

(I tried to use gb1 = Graph Builder 1; gb2 = Graph Builder 2; gb3 = ... but I don't think it is an effective way.)

 

NW = New Window("GRA", LB = Lineup Box(N Col( 2 )));

LB << Append(
Graph Builder(
		Variables(X,Y...
Graph Builder(
		Variables(X,Y...
Graph Builder(
		Variables(X,Y...
);
TotalGB = LB << xpath("//LineUpBox/Box");  # This is wrong for selecting graph object #
For( ii = 1, ii <= N Items(TotalGB), ii++,
	TotalGB[ii] << Size( 800, 500 );
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: [Graph Builder in JSL] how to select graph build as an object in one Lineup Box

If you are adding them this way, you could create the references while appending them (collect them into a list and not separate variables). If you wish to use XPath you can do something like

Names Default To Here(1); 

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

nw = New Window("", lub = Lineup Box());

lub << Append(
	gb = dt << Graph Builder(
		Variables(X(:weight), Y(:height), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	)
);
lub << Append(
	gb = dt << Graph Builder(
		Variables(X(:weight), Y(:height), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	)
);


gbs = (lub << XPath("//OutlineBox[@helpKey = 'Graph Builder']")) << get scriptable object;

without XPath for example

Names Default To Here(1); 

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

nw = New Window("", lub = Lineup Box());

gbs = {};
lub << Append(
	gb = dt << Graph Builder(
		Variables(X(:weight), Y(:height), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	)
);
Insert Into(gbs, gb);
lub << Append(
	gb = dt << Graph Builder(
		Variables(X(:weight), Y(:height), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	)
);
Insert Into(gbs, gb);

show(gbs);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: [Graph Builder in JSL] how to select graph build as an object in one Lineup Box

If you are adding them this way, you could create the references while appending them (collect them into a list and not separate variables). If you wish to use XPath you can do something like

Names Default To Here(1); 

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

nw = New Window("", lub = Lineup Box());

lub << Append(
	gb = dt << Graph Builder(
		Variables(X(:weight), Y(:height), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	)
);
lub << Append(
	gb = dt << Graph Builder(
		Variables(X(:weight), Y(:height), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	)
);


gbs = (lub << XPath("//OutlineBox[@helpKey = 'Graph Builder']")) << get scriptable object;

without XPath for example

Names Default To Here(1); 

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

nw = New Window("", lub = Lineup Box());

gbs = {};
lub << Append(
	gb = dt << Graph Builder(
		Variables(X(:weight), Y(:height), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	)
);
Insert Into(gbs, gb);
lub << Append(
	gb = dt << Graph Builder(
		Variables(X(:weight), Y(:height), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	)
);
Insert Into(gbs, gb);

show(gbs);
-Jarmo
Clanlope
Level III

Re: [Graph Builder in JSL] how to select graph build as an object in one Lineup Box

Hello jthi,

It works, really appreciate it!

Recommended Articles