cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-876161%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EY-axis%20auto-scaling%20on%20Graph%20Builder%20plot%20cuts%20off%20spec%20limit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-876161%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhen%20generating%20a%20plot%20in%20Graph%20Builder%2C%20it%20does%20a%20good%20job%20of%20autoscaling%20the%20Y-axis%20to%20the%20outermost%20data%20points.%20%26nbsp%3BHowever%2C%20this%20doesn't%20consider%20the%20spec%20limit%20values%2C%20which%20are%20generally%20outside%20of%20the%20outermost%20data.%20%26nbsp%3BSo%20a%20spec%20limit%20may%20not%20be%20visible.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIs%20there%20a%20setting%2C%20button%2C%20method%2C%20or%2C%20(preferably)%2C%20a%20simple%20JSL%20way%20of%20getting%20the%20Y-axis%20scaling%20to%20default%20to%20the%20outermost%20of%20data%20%26amp%3B%20spec%20limits%3F%20%26nbsp%3B(A%20brute%20force%20method%20would%20be%20to%20loop%20on%20checking%20min%20%26amp%3B%20max%20of%20all%20data%20%26amp%3B%20spec%20limits%2C%20then%20setting%20the%20axis%20range%20just%20beyond%20those%20values.%20%26nbsp%3BBut%20I'm%20hoping%20to%20avoid%20this.)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExample%20plot%20below%20showing%20the%20LSL%20cut%20off%20from%20the%204th%20of%205%20box%20plots.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-876161%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomation%20and%20Scripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-876200%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Y-axis%20auto-scaling%20on%20Graph%20Builder%20plot%20cuts%20off%20spec%20limit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-876200%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIs%20your%20x%20axis%20coming%20from%205%20different%20columns%2C%20or%20from%201%20ordinal%2Fnominal%20column%20with%205%20levels%3F%3C%2FP%3E%0A%3CP%3EIs%20the%20%22Show%20Limits%22%20checkbox%20selected%20in%20the%20Spec%20Limits%20Column%20Property%3F%26nbsp%3B%20If%20this%20is%20checked%2C%20and%20the%20Y%20Axis%20Setting%20have%20not%20been%20specified%2C%20then%20by%20default%2C%20the%20Spec%20Limits%20should%20be%20displayed%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20version%20of%20JMP%2C%20what%20operating%20system%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-876201%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Y-axis%20auto-scaling%20on%20Graph%20Builder%20plot%20cuts%20off%20spec%20limit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-876201%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%2C%20Jim.%20%26nbsp%3BJMP%20Pro%2017.2.0%20on%20MacOS.%20%26nbsp%3BThey%20are%205%20different%20columns%2C%20but%20the%20script%20is%20actually%20built%20by%20another%20JSL%20script%2C%20so%20might%20look%20a%20little%20different%20%E2%80%94%20(see%20below).%3C%2FP%3E%0A%3CP%3ELooks%20like%20Y%20Axis%20Setting%20is%20not%20specified.%20%26nbsp%3BIn%20Column%20Properties%2C%20I%20see%20%22Show%20as%20Graph%20Reference%20Lines%22%20(if%20that's%20what%20you're%20referring%20to).%20%26nbsp%3BHowever%2C%20checking%20that%20box%2C%20then%20creating%20a%20new%20graph%20via%20Graph%20Builder%20doesn't%20seem%20to%20fix%20the%20issue.%3C%2FP%3E%0A%3CP%3EPerhaps%2C%20is%20it%20possible%20to%20suggest%20a%20piece%20of%20JSL%20in%20the%20script%20below%20to%20enable%20the%20feature%20you%20describe%3F%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EGraph%20Builder(%0A%09Size(%201000%2C%20700%20)%2C%0A%09Show%20Control%20Panel(%200%20)%2C%0A%09Show%20Legend(%200%20)%2C%0A%09Variables(%0A%09%09X(%0A%09%09%09%22stage_10%22%2C%0A%09%09%09Combine(%20%22Parallel%20Merged%22%20)%0A%09%09)%2C%0A%09%09X(%0A%09%09%09%22stage_2%22%2C%0A%09%09%09Position(%201%20)%2C%0A%09%09%09Combine(%20%22Parallel%20Merged%22%20)%0A%09%09)%2C%0A%09%09X(%0A%09%09%09%22stage_4%22%2C%0A%09%09%09Position(%201%20)%2C%0A%09%09%09Combine(%20%22Parallel%20Merged%22%20)%0A%09%09)%2C%0A%09%09X(%0A%09%09%09%22stage_5%22%2C%0A%09%09%09Position(%201%20)%2C%0A%09%09%09Combine(%20%22Parallel%20Merged%22%20)%0A%09%09)%2C%0A%09%09X(%0A%09%09%09%22stage_6%22%2C%0A%09%09%09Position(%201%20)%2C%0A%09%09%09Combine(%20%22Parallel%20Merged%22%20)%0A%09%09)%0A%09)%2C%0A%09Elements(%0A%09%09Box%20Plot(%0A%09%09%09X(%201%20)%2C%0A%09%09%09X(%202%20)%2C%0A%09%09%09X(%203%20)%2C%0A%09%09%09X(%204%20)%2C%0A%09%09%09X(%205%20)%2C%0A%09%09%09Legend(%203%20)%2C%0A%09%09%09Jitter(%20%22Random%20Normal%22%20)%0A%09%09)%2C%0A%09%09Caption%20Box(%20X(%201%20)%2C%20Legend(%204%20)%2C%20Summary%20Statistic(%20%22N%22%20)%20)%0A%09)%2C%0A%09SendToReport(%0A%09%09Dispatch(%0A%09%09%09%7B%7D%2C%0A%09%09%09%22stage_10%22%2C%0A%09%09%09ScaleBox%2C%0A%09%09%09%7BLabel%20Row(%0A%09%09%09%09%7BTick%20Mark(%0A%09%09%09%09%09Label(%20%22stage_10%22%20)%2C%0A%09%09%09%09%09Label(%20%2210%22%20)%0A%09%09%09%09)%2C%20Tick%20Mark(%0A%09%09%09%09%09Label(%20%22stage_2%22%20)%2C%0A%09%09%09%09%09Label(%20%222%22%20)%0A%09%09%09%09)%2C%20Tick%20Mark(%0A%09%09%09%09%09Label(%20%22stage_4%22%20)%2C%0A%09%09%09%09%09Label(%20%224%22%20)%0A%09%09%09%09)%2C%20Tick%20Mark(%0A%09%09%09%09%09Label(%20%22stage_5%22%20)%2C%0A%09%09%09%09%09Label(%20%225%22%20)%0A%09%09%09%09)%2C%20Tick%20Mark(%0A%09%09%09%09%09Label(%20%22stage_6%22%20)%2C%0A%09%09%09%09%09Label(%20%226%22%20)%0A%09%09%09%09)%2C%20Set%20Font%20Size(%2014%20)%2C%20Label%20Orientation(%20%22Horizontal%22%20)%7D%0A%09%09%09)%7D%0A%09%09)%2C%0A%09%09Dispatch(%20%7B%7D%2C%20%22%22%2C%20ScaleBox%2C%20%7BLabel%20Row(%20Set%20Font%20Size(%2014%20)%20)%7D%20)%2C%0A%09%09Dispatch(%0A%09%09%09%7B%7D%2C%0A%09%09%09%22graph%20title%22%2C%0A%09%09%09TextEditBox%2C%0A%09%09%09%7BSet%20Text(%20%22My%20Graph%22%20)%7D%0A%09%09)%2C%0A%09%09Dispatch(%20%7B%7D%2C%20%22X%20title%22%2C%20TextEditBox%2C%20%7BSet%20Text(%20%22%22%20)%7D%20)%2C%0A%09%09Dispatch(%0A%09%09%09%7B%7D%2C%0A%09%09%09%22Graph%20Builder%22%2C%0A%09%09%09FrameBox%2C%0A%09%09%09%7BDispatchSeg(%20Text%20Seg(%201%20)%2C%20%7BFont(%20%22Helvetica%22%2C%2018%20)%7D%20)%7D%0A%09%09)%0A%09)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-876205%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Y-axis%20auto-scaling%20on%20Graph%20Builder%20plot%20cuts%20off%20spec%20limit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-876205%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESpecifying%20multiple%20variables%20for%20the%20X%20axis%20seems%20to%20negate%20the%20auto%20scaling%20for%20the%20Spec%20Limits.%26nbsp%3B%20The%20only%20solution%20that%20I%20see%20would%20be%20to%20add%20to%20your%20JSL%20the%20setting%20of%20the%20Y%20to%20set%20the%20axis%20min%20and%20max%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
SteveTerry
Level III

Y-axis auto-scaling on Graph Builder plot cuts off spec limit

When generating a plot in Graph Builder, it does a good job of autoscaling the Y-axis to the outermost data points.  However, this doesn't consider the spec limit values, which are generally outside of the outermost data.  So a spec limit may not be visible.

 

Is there a setting, button, method, or, (preferably), a simple JSL way of getting the Y-axis scaling to default to the outermost of data & spec limits?  (A brute force method would be to loop on checking min & max of all data & spec limits, then setting the axis range just beyond those values.  But I'm hoping to avoid this.)

 

Example plot below showing the LSL cut off from the 4th of 5 box plots. 

3 REPLIES 3
txnelson
Super User

Re: Y-axis auto-scaling on Graph Builder plot cuts off spec limit

Is your x axis coming from 5 different columns, or from 1 ordinal/nominal column with 5 levels?

Is the "Show Limits" checkbox selected in the Spec Limits Column Property?  If this is checked, and the Y Axis Setting have not been specified, then by default, the Spec Limits should be displayed

 

What version of JMP, what operating system?

 

Jim
SteveTerry
Level III

Re: Y-axis auto-scaling on Graph Builder plot cuts off spec limit

Thanks, Jim.  JMP Pro 17.2.0 on MacOS.  They are 5 different columns, but the script is actually built by another JSL script, so might look a little different — (see below).

Looks like Y Axis Setting is not specified.  In Column Properties, I see "Show as Graph Reference Lines" (if that's what you're referring to).  However, checking that box, then creating a new graph via Graph Builder doesn't seem to fix the issue.

Perhaps, is it possible to suggest a piece of JSL in the script below to enable the feature you describe?

Graph Builder(
	Size( 1000, 700 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables(
		X(
			"stage_10",
			Combine( "Parallel Merged" )
		),
		X(
			"stage_2",
			Position( 1 ),
			Combine( "Parallel Merged" )
		),
		X(
			"stage_4",
			Position( 1 ),
			Combine( "Parallel Merged" )
		),
		X(
			"stage_5",
			Position( 1 ),
			Combine( "Parallel Merged" )
		),
		X(
			"stage_6",
			Position( 1 ),
			Combine( "Parallel Merged" )
		)
	),
	Elements(
		Box Plot(
			X( 1 ),
			X( 2 ),
			X( 3 ),
			X( 4 ),
			X( 5 ),
			Legend( 3 ),
			Jitter( "Random Normal" )
		),
		Caption Box( X( 1 ), Legend( 4 ), Summary Statistic( "N" ) )
	),
	SendToReport(
		Dispatch(
			{},
			"stage_10",
			ScaleBox,
			{Label Row(
				{Tick Mark(
					Label( "stage_10" ),
					Label( "10" )
				), Tick Mark(
					Label( "stage_2" ),
					Label( "2" )
				), Tick Mark(
					Label( "stage_4" ),
					Label( "4" )
				), Tick Mark(
					Label( "stage_5" ),
					Label( "5" )
				), Tick Mark(
					Label( "stage_6" ),
					Label( "6" )
				), Set Font Size( 14 ), Label Orientation( "Horizontal" )}
			)}
		),
		Dispatch( {}, "", ScaleBox, {Label Row( Set Font Size( 14 ) )} ),
		Dispatch(
			{},
			"graph title",
			TextEditBox,
			{Set Text( "My Graph" )}
		),
		Dispatch( {}, "X title", TextEditBox, {Set Text( "" )} ),
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{DispatchSeg( Text Seg( 1 ), {Font( "Helvetica", 18 )} )}
		)
	)
)
txnelson
Super User

Re: Y-axis auto-scaling on Graph Builder plot cuts off spec limit

Specifying multiple variables for the X axis seems to negate the auto scaling for the Spec Limits.  The only solution that I see would be to add to your JSL the setting of the Y to set the axis min and max;

Jim

Recommended Articles