cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Herrera5238
Level III

Set Frame Size for multiple charts

My current script gives me multiple charts by the different product's. Which is what I'm looking for.

Now I'd like to make all those charts have the same frame size. I'm finding that I have to be specific when I use dispatch and have to write every single outline name.

The issue with that is that there will be different products every time I run it and I'd prefer not to have to go in and change the names every time.

 

Is there a way to automate this.

Data Table( "Data for Comparison" ) << Variability Chart(
	Y( Column( "Mean(Bin_VALUE)" ) ),
	X( :Bin_Size, :Status_Type2 ),
	By( :Product ),
	Show Box Plots( 1 ),
	Std Dev Chart( 0 ),
	SendToReport(
		Dispatch(
			{"Variability Gauge Product= Product 1", "Variability Chart for Mean(Bin_VALUE)"},
			"Variability Chart",
			FrameBox,
			{Frame Size( 800, 240 )}
		), 

	)
);
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Set Frame Size for multiple charts

You can use XPath to retrieve all of the FrameBox() objects, and then set the Frame Size to all of them

vc = Data Table( "Data for Comparison" ) << Variability Chart(
	Y( Column( "Mean(Bin_VALUE)" ) ),
	X( :Bin_Size, :Status_Type2 ),
	By( :Product ),
	Show Box Plots( 1 ),
	Std Dev Chart( 0 ),
);

(Report(vc) << xpath("//FrameBox")) << Frame Size( 800, 240 );
Jim

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: Set Frame Size for multiple charts

You can use XPath to retrieve all of the FrameBox() objects, and then set the Frame Size to all of them

vc = Data Table( "Data for Comparison" ) << Variability Chart(
	Y( Column( "Mean(Bin_VALUE)" ) ),
	X( :Bin_Size, :Status_Type2 ),
	By( :Product ),
	Show Box Plots( 1 ),
	Std Dev Chart( 0 ),
);

(Report(vc) << xpath("//FrameBox")) << Frame Size( 800, 240 );
Jim
Herrera5238
Level III

Re: Set Frame Size for multiple charts

Jim,

 

This worked.

 

Could I use the same concept in the scenario below, in order to set the titles. Withouth having to type each one of them.

So go from this 

Template_TM = Expr(
	TM = Oneway(
		Y( Eval( TargetParameter )),
		X( :Process ),
		Each Pair( 1 ),
		Means and Std Dev( 1 ),
		t Test( 1 ),
		Points Jittered( 1 ),
		Box Plots( 1 ),
		Mean Error Bars( 1 ),
		Std Dev Lines( 1 ),
		Comparison Circles( 1 ),
		X Axis Proportional( 0),
		Histograms( 0),
		//Where( :PARAMETER_ID == Eval( TargetParameter )),
		SendToReport(
			Dispatch( {}, "Oneway Analysis of 0.12 By Process", OutlineBox(1), {Set Title( TargetProduct ||"_Oneway Analysis at_" || TargetParameter )} ),
			Dispatch( {}, "Oneway Analysis of 0.16 By Process", OutlineBox(1), {Set Title( TargetProduct ||"_Oneway Analysis at_" || TargetParameter )} ),
			Dispatch( {}, "Oneway Analysis of 0.2 By Process", OutlineBox(1), {Set Title( TargetProduct ||"_Oneway Analysis at_" || TargetParameter )} ),
			Dispatch( {}, "Oneway Analysis of 0.3 By Process", OutlineBox(1), {Set Title( TargetProduct ||"_Oneway Analysis at_" || TargetParameter )} ),
			Dispatch( {}, "1", ScaleBox, {Min( 0 ), Minor Ticks( 1 ), Add Ref Line(Eval(Limit_UCL), "Dotted", "Dark Blue", "UCL", 1)}),
			Dispatch( {}, "Oneway Plot", FrameBox, ),
			Dispatch( {}, "Means Comparisons", OutlineBox, {Close( 1 )} )
		)
	);
);

to this?

Template_TM = Expr(
	TM = Oneway(
		Y( Eval( TargetParameter )),
		X( :Process ),
		Each Pair( 1 ),
		Means and Std Dev( 1 ),
		t Test( 1 ),
		Points Jittered( 1 ),
		Box Plots( 1 ),
		Mean Error Bars( 1 ),
		Std Dev Lines( 1 ),
		Comparison Circles( 1 ),
		X Axis Proportional( 0),
		Histograms( 0),
		//Where( :PARAMETER_ID == Eval( TargetParameter )),
		SendToReport(
			Dispatch( {}, "1", ScaleBox, {Min( 0 ), Minor Ticks( 1 ), Add Ref Line(Eval(Limit_UCL), "Dotted", "Dark Blue", "UCL", 1)}),
			Dispatch( {}, "Oneway Plot", FrameBox, ),
			Dispatch( {}, "Means Comparisons", OutlineBox, {Close( 1 )} )
		)
	);
);
(TM<<xpath("//OutlineBox"))<<Set Title( TargetProduct ||"_Oneway Analysis at_" || TargetParameter );

Re: Set Frame Size for multiple charts

The fact is, we are not meant to use the Send To Report directive. This way is intended only so that JMP can capture report layer customizations when you save a script. Try the recommended way:

platform = Data Table( "Data for Comparison" ) << Variability Chart(
	Y( Column( "Mean(Bin_VALUE)" ) ),
	X( :Bin_Size, :Status_Type2 ),
	By( :Product ),
	Show Box Plots( 1 ),
	Std Dev Chart( 0 )
);

Report( platform )[FrameBox(1)] << Frame Size( 800, 240 );

Easy, eh?

 

Herrera5238
Level III

Re: Set Frame Size for multiple charts

Mark,

 

I tried this but none of the charts changed size. It did not work. 

I'm very new to JMP scipting so I'm sorry if this obeservation isn't helpful but one thing that I noticed when I pasted your script is that platform didn't turn blue.

Not sure if there is something else I'm missing.

Re: Set Frame Size for multiple charts

My solution is essentially the same as Jim's answer. I saved a reference to the plotting platform and then used it with subscripting to send the message. Jim used XPath to return the reference before sending the message. You would have to store the reference when you open each platform in a list and then send the message to the list if you want to use my approach. For example:

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

platform = List();

p = dt << Bivariate(
	Y( :weight ),
	X( :height ),
);

Insert Into( platform, Report( p )[FrameBox(1)] );

p = dt << Oneway(
	Y( :weight ),
	X( :age ),
);

Insert Into( platform, Report( p )[FrameBox(1)] );

platform << Frame Size( 800, 240 );

 

Jim's solution is more elegant.

There is no mention above about selecting display boxes so they are highlighted in blue. That result is accomplished with the << Select message.