cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
mosiph
Level I

Change X-Axis Label Orientation

Hi,

In the variability chart, I am trying to change the text orientation of one of the X variables. Here is the part of the code.

X_List = {"SPLIT", "LOTID", "Tool", "Boat", "Wfrid"};

varChartObj = Variability Chart(
	Y( collist[i] ),
	X( Eval(X_List) ),
	Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
	Std Dev Chart( 0 ),
	Show Box Plots( 1 ),
);
report(varChartObj)[Frame Box(1)]<< Row Legend( Eval(X_Legend),  Color( 1 ), Marker( 0 ) );
report(varChartObj)[axisbox(1)]<< Add Ref Line( LSL, "Solid", "Red", "LSL", 1 );
report(varChartObj)[axisbox(1)]<< Add Ref Line( USL, "Solid", "Red", "USL", 1 );
report(varChartObj)[axisbox(1)]<< Add Ref Line( Target, "Dashed", "Red", "Target", 1 );
report(varChartObj)[axisbox(1)]<< min(LSL-0.1*(USL-LSL));
report(varChartObj)[axisbox(1)]<< max(USL+0.1*(USL-LSL));
report(varChartObj)[axisbox(1)]<< Inc(0.1*abs(USL-LSL));

Appreciate if someone can show me how I can achieve it. Say if I want to change X variable "Tool" to vertical orientation.

 

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Change X-Axis Label Orientation

I believe you need to change ScaleBox to AxisBox

Jim

View solution in original post

8 REPLIES 8
ian_jmp
Level X

Re: Change X-Axis Label Orientation

It's almost always good to 'do it by hand', then inspect the code that JMP generates for you:

NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Variability Chart(
				Y( :height ),
				X( :age, :sex ),
				Std Dev Chart( 0 ),
				SendToReport(
					Dispatch(
						{"Variability Chart for height"},
						"",
						NomAxisBox,
						{Rotated Tick Labels( 1 )}
					)
				)
			);
mosiph
Level I

Re: Change X-Axis Label Orientation

Yes, I did. After looking at the script generated, I tried:

report(varChartObj)[ScaleBox(2)]<< Label Row( 3, Label Orientation( "Vertical" ));

 

But it did not work.

Btw, I am using loop to generate many plots at one time.

txnelson
Super User

Re: Change X-Axis Label Orientation

I believe you need to change ScaleBox to AxisBox

Jim
mosiph
Level I

Re: Change X-Axis Label Orientation

Awesome. Thanks a lot.

JMPNewbie
Level I

Re: Change X-Axis Label Orientation

Hi @txnelson

 

If there are many row need to be rotated, is the only way to address all rows number?

or does it have any way to do it at once instead of use loop to generate it?

 

Thank you in advance!

 

Best regards

txnelson
Super User

Re: Change X-Axis Label Orientation

A separate call to each specific NomAxisBox() for each column specified in the "X Grouping" area of the Variability dialog box will have to be made 

Jim
JMPNewbie
Level I

Re: Change X-Axis Label Orientation

Hi @txnelson

Thank you for the quick reply, i do try to use nom axis box which @ian_jmp showed at the previous answer

however, it seems no work by use nom axis box(2) to rotate it ....

Sorry for the question, i still newbie working with JMP 

GenTabRpt = Function( {dt_chart, _CATE, _PARM},
rc = dt_chart << report;
_PARM = Munger( _PARM, (Munger( _PARM, 1, "/" )), "/", "_" );
If( Contains Item( _PARM, "IBL0", "_" ),
rc[axis box( 1 )] << Scale( "Log" ) << Show Minor Labels( 0 ) << Min( 1e-1 ),

);
If( Contains Item( _PARM, "Ir0", "_" ),
rc[axis box( 1 )] << Scale( "Log" ) << Show Minor Labels( 0 ) << Min( 1e-12 ) << Max( 1e-5 ),

);
If( Contains Item( _PARM, "T2P", "_" ),
rc[axis box( 1 )] << Scale( "Log" ) << Show Minor Labels( 0 ) << Min( 1e-9 ) << Max( 1e-3 ),

);
If(
Contains Item( _PARM, "Iread", "_" ) :| Contains Item( _PARM, "Ir1", "_" ) :| Contains Item( _PARM, "Ir0", "_" ) :|
Contains Item( _PARM, "T2P", "_" ),
rc[axis box( 1 )] << Format( Scientific ),

);
If( dt_chart == "Variability Chart[]",
rc[Text Edit Box( 1 )] << Set Font Size( 1 ) << Hide( 1 ),

);
rc[Nom Axis Box(2)] << Rotated Tick Labels( 0 );
rc[FrameBox( 1 )] << Marker Size( 3 );// << Frame Size (850,240);
rc[axis box( 2 )] << Show Major Grid( 1 );
/* << Label Row( 5, Label Orientation( "Vertical" ) ) 
<< Label Row( 6, Label Orientation( "Vertical" ) )
<< Label Row( 7, Label Orientation( "Vertical" ) )
<< Label Row( 8, Label Orientation( "Vertical" ) )
<< Label Row( 9, Label Orientation( "Vertical" ) )
<< Label Row( 10, Label Orientation( "Vertical" ) );
*/ rc[Outline Box( 2 )] << set title( Char( _PARM ) );
rc[Outline Box( 2 )] << save picture( RPTFolder || Char( _PARM ) || ".emf" );
If( _CATE == "MISSING",
_CATE = "WAT_Summary_Plot"
);
If( _CATE != _PreCATE,
tb << Append( _CATE, vlb = V List Box() );
vlb << append( rc );
dt_chart << close window;
,
vlb << append( rc );
dt_chart << close window;
);
Insert Into( TestList, Char( _PARM ) );
Insert Into( CateList, Char( _CATE ) );
_PreCATE = _CATE;
);

 

txnelson
Super User

Re: Change X-Axis Label Orientation

It is pretty tough figuring out where the issue(s) is/are without having the actual Variability chart JSL.  One would need to examine the Report Tree Structure to find out why a reference to NomAxisBox(2) may not be a proper reference.  Below is a simple script that has 3 X columns specified, with all 3 of their axis values rotated.   The code then goes back and  changes the 3rd level tick labels back to unrotated.  Try examining the Tree Structure so you can see how it works.

names default to here(1);
New Table( "Example",
	Add Rows( 15 ),
	New Column("lot_id",
		Character,
		"Nominal",
		Set Values(
			{"lot1", "lot1", "lot1", "lot1", "lot1", "lot2", "lot2", "lot2", "lot2",
			"lot2", "lot3", "lot3", "lot3", "lot3", "lot3"}
		)
	),
	New Column("wafer",
		Numeric( 1 ),
		"Nominal",
		Set Values( [3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] )
	),
	New Column("SITE", 
		Numeric( 1 ),
		"Nominal",
		Set Values( [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5] )
	),
	New Column("NPN1",
		Numeric,
		"Continuous",
		Format( "Best", 10 ),
		Set Values(
			[114.946183872216, 113.382890501824, 114.666518192776, 107.884015560041,
			113.065582322339, 114.857323947632, 114.559464479242, 114.221688530977,
			112.349531387849, 113.253501139582, 113.07512667471, 114.613256881221,
			112.309137695657, 115.116308198793, 116.436528584316]
		)
	)
);
vc=Variability Chart(
	Y( :NPN1 ),
	X( :lot_id, :wafer, :SITE ),
	Max Iter( 100 ),
	Conv Limit( 0.00000001 ),
	Number Integration Abscissas( 128 ),
	Number Function Evals( 65536 ),
	Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
	Std Dev Chart( 0 ),
	SendToReport(
		Dispatch(
			{"Variability Chart for NPN1"},
			"",
			NomAxisBox,
			{Rotated Tick Labels( 1 )}
		),
		Dispatch(
			{"Variability Chart for NPN1"},
			"",
			NomAxisBox( 2 ),
			{Rotated Tick Labels( 1 )}
		),
		Dispatch(
			{"Variability Chart for NPN1"},
			"",
			NomAxisBox( 3 ),
			{Rotated Tick Labels( 1 ), Set Width( 980 ), Set Height( 21 )}
		)
	)
);
report(vc)[Nom Axis Box( 3 )] << Rotated Tick Labels( 0 );
Jim