cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
Thierry_S
Super User

Graph Builder in Loop: How do I maintain Y-axis scale across each column?

Hi JMP Community,

 

I just ran into a little problem with the auto-scalling of axis in the GB platform.

I wish to loop through 100 columns to plot some data on a fixed Y scale (i.e. Min = -1.3, Max = 0.2, Increment = 0.2).

When I save the script from GB, the SendToReport > Dispatch command refers to the Y Axis by its label ("Y-Axis") which will change for each column when I loop through my 100 columns. Thus, how do I replace the expression on line #11 with a relative reference (I tried: Column Name (i) without success). 

Here is the snippet of the code I'm trying to Loop through:

 

Graph Builder(
	Variables(
		X( :Visit Description ),
		Y( column(i) ),
		Overlay( :TRT01 )
	),
	Elements( Line( X, Y, Legend( 9 ), Error Bars( "Standard Error" ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Y AXIS", // Column Name (i)?
			ScaleBox,
			{Min( -1.3 ), Max( 0.3 ), Inc( 0.2 ), Minor Ticks( 1 )}
		)
	)
);

NOTE: I tried to Lock the axis without success.

 

Thank you for your help.

 

Sincerely,

 

TS

Thierry R. Sornasse
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Graph Builder in Loop: How do I maintain Y-axis scale across each column?

Try this:

Graph Builder(
	Variables(
		X( :Visit Description ),
		Y( column(i) ),
		Overlay( :TRT01 )
	),
	Elements( Line( X, Y, Legend( 9 ), Error Bars( "Standard Error" ) ) ),
	SendToReport(
		Dispatch(
			{},
			eval(column(i)<<get name), // Column Name (i)?
			ScaleBox,
			{Min( -1.3 ), Max( 0.3 ), Inc( 0.2 ), Minor Ticks( 1 )}
		)
	)
);
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Graph Builder in Loop: How do I maintain Y-axis scale across each column?

Try this:

Graph Builder(
	Variables(
		X( :Visit Description ),
		Y( column(i) ),
		Overlay( :TRT01 )
	),
	Elements( Line( X, Y, Legend( 9 ), Error Bars( "Standard Error" ) ) ),
	SendToReport(
		Dispatch(
			{},
			eval(column(i)<<get name), // Column Name (i)?
			ScaleBox,
			{Min( -1.3 ), Max( 0.3 ), Inc( 0.2 ), Minor Ticks( 1 )}
		)
	)
);
Jim