cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Jackie_
Level VI

Scale axis fit group

Hello JMP Community,

 

I am trying to write a jsl code that can scale the axis with button box.

I want to scale axis for all three oneway plots in the fit group.

 

The below code works only for the first one way chart.

 

Any suggestions?

 


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

New Window( "",
	H List Box(
		Button Box( "Scale axis   ", 		
			Try( fsl = fg << report );					
		
			(fsl)[AxisBox( 1 )] << Min( 20 ) << Max( 100 );
		), 
																				
		V List Box(
																
			fg = Fit Group(
				Oneway( Y( :height ), X( :name ) ),
				Oneway( Y( :height ), X( :age ) ),
				Oneway( Y( :height ), X( :sex ) ),
				<<{Arrange in Rows( 1 )}
			);


		)
	)
										
						
										
);

Thanks, 

Jackie

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Scale axis fit group

You could get the references to Axisboxes with XPath. The XPath I use here is most likely not robust enough and should be improved

Names Default To Here(1);

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

nw = New Window("",
	H List Box(
		Button Box("Scale axis   ",
			Try(fsl = fg << report;
				axisboxes = fsl << XPath("//AxisBox");
				axisboxes[1::N Items(axisboxes) - 1::3] << Min(20) << Max(100);				
			);
		),
		V List Box(
			fg = Fit Group(
				Oneway(Y(:height), X(:name)),
				Oneway(Y(:height), X(:age)),
				Oneway(Y(:height), X(:sex)),
				<<{Arrange in Rows(1)}
			);
		)
	)
);

Or you can get references to outline boxes and then loop the AxisBox(1)

ows = fg << XPath("//OutlineBox[contains(text(), 'Oneway Analysis of')]");
For Each({ow}, ows,
	ow[AxisBox(1)] <<Min(10) << Max(150);
);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Scale axis fit group

You could get the references to Axisboxes with XPath. The XPath I use here is most likely not robust enough and should be improved

Names Default To Here(1);

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

nw = New Window("",
	H List Box(
		Button Box("Scale axis   ",
			Try(fsl = fg << report;
				axisboxes = fsl << XPath("//AxisBox");
				axisboxes[1::N Items(axisboxes) - 1::3] << Min(20) << Max(100);				
			);
		),
		V List Box(
			fg = Fit Group(
				Oneway(Y(:height), X(:name)),
				Oneway(Y(:height), X(:age)),
				Oneway(Y(:height), X(:sex)),
				<<{Arrange in Rows(1)}
			);
		)
	)
);

Or you can get references to outline boxes and then loop the AxisBox(1)

ows = fg << XPath("//OutlineBox[contains(text(), 'Oneway Analysis of')]");
For Each({ow}, ows,
	ow[AxisBox(1)] <<Min(10) << Max(150);
);
-Jarmo
Jackie_
Level VI

Re: Scale axis fit group

Awesome! Thanks a lot Jarmo!