cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
PCameh
Level II

Change the default color of box plot lines

I've seen multiple posts related to this topic, but most solutions either direct to use Graph Builder or to temporarily script as a workaround. What I want to know is - if there is a way to set the default color of the box plots in the Variability Chart to black (from the current default red)? I'm using JMP 14.3. Any help would be greatly appreciated!

 

Change the color of red in the following to black is what I want to accomplish by default:

ba_oneway_anova-2.png

12 REPLIES 12

Re: Change the default color of box plot lines

Thank you so much! How do I set this up if I am taking the X and Y variables from the user and not already defined in the script?

hogi
Level XII

Re: Change the default color of box plot lines

Then you have to send the corresponding commands after the user filled the GUI and clicked on OK.

 

Either: build a mini-GUI where the user can pick the columns and use the response to trigger the Variability Chart analysis:

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

colDialog = Column Dialog(
			YCols = ColList( "Y", Min Col( 1 ), Max Col( 1 ), Data Type( "Numeric" ) ),
			grouping = ColList( "Grouping", Min Col( 1 ), Max Col( 1 ), Data Type( "Nominal" ) ));
	
 myPlot = Eval (Eval Expr(Variability Chart(
	Y( colDialog["Ycols"][1] ),
	X( colDialog["grouping"] ),
	Variability Analysis( Expr(colDialog["Ycols"][1]), Show Box Plots( 1 ) ))));


mySegs=report(myPlot)[FrameBox(1)]<< find segs; // get all display elements
Filter Each({seg},(mySegs), (seg<< class name)=="BoxPlotSeg") //just keep the Box Plots
 << Set Line Color("Black") 

... or use the GUI of the Variability Chart Analysis itself - and after the Report is generated, send the code to generate the box plot and change the color.
after -> <<Type( "Modal Dialog" )

new window("GUI", 	
	<<Type( "Modal Dialog" ),
Variability Chart());

// code to generate the Box Plots and change the color 

... but the <<Type( "Modal Dialog" ) prevents the GUI to generate the Report.
the result is just {Button( 1 )}

so, I am stuck at this point.

hogi
Level XII

Re: Change the default color of box plot lines

By the way, you could also use GraphBuilder to generate the graph:

hogi_0-1717570173832.png

 

 

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
	Variables( X( :age ), Y( :height ), Y( :height ) ),
	Elements(
		Position( 1, 1 ),
		Points( X, Y ),
		Box Plot( X, Y )
	),
	Elements(
		Position( 1, 2 ),
		Points( X, Y,  Summary Statistic( "Std Dev" ) )
	),
	SendToReport(
		Dispatch( {}, "age", ScaleBox,
			{Label Row(
				{Lower Frame( 1 ), Row Title Side( "End" ),
				Tick Mark Style( "Long Divider" )}
			)}
		),
		Dispatch( {}, "height", ScaleBox,
			
			 Label Row( Row Title Side( "Start" ) )}
		),
		Dispatch( {}, "Y 1 title", TextEditBox, {Set Text( "std dev" )} )
	)
);