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
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

1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Change the default color of box plot lines

@PCameh ,

 

You can create a custom Oneway UI.  Try the script below, it calls up the built-in Oneway dialog.  For this script, as long as there are 10 or less category groups all the boxplots will be black. If Big Class.jmp is the current data table and you run this script, use Height and Weight for Y, age for X and sex by BY all your boxplots will be black.  

 

If the JMP table Semiconductor Capability.jmp is the current table and you run this script, use numerous process variables as Y and lot_id as X,

the first 10 boxplots  are black, however, there are 13 lot_id's.

 

Off the top of my head, I do not have alternate syntax to make this truly flexible. So, one option is to modify this script to accommodate a large number of category values, maybe 100. Then save this script to your main menu, maybe call it my Oneway. Note you can also customize the line width, etc with a few edits to the script.

 

 

Oneway(
	Box Plots( 1 ),
	X Axis Proportional( 0 ),
	Points Jittered( 1 ),
	
	SendToReport(

		Dispatch(
			{},
			"Oneway Plot",
			FrameBox,
			{DispatchSeg( Box Plot Seg( 1 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 2 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 3 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 4 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 5 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 6 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 7 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 8 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 9 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 10 ), Confidence Diamond( 0 ), Set Line Color("Black") )
			}		
	)
  )
);

View solution in original post

12 REPLIES 12
txnelson
Super User

Re: Change the default color of box plot lines

I do not know of any preference that will change the default boxplot color for the boxplot. Other than interactively going into the custom menu and changing the color, the only other way that I know is using JSL to change the Box Plot Segment line color
Jim
PCameh
Level II

Re: Change the default color of box plot lines

Thanks!

 

From all the searching I did on the JMP forums, it seems there does not exist an easy way to do this. The only practical solution I found was from @gzmorgan0, in the form of an add-in to change the colors to black after creating a plot: https://community.jmp.com/t5/Discussions/Customize-box-plot-color-in-JMP-preferences/td-p/63157.

 

While this is incredibly useful, it still requires a key-click (even with a hotkey) after every plot.


Wondering if JMP admins/engineers would know of a workaround...

txnelson
Super User

Re: Change the default color of box plot lines

Add this to the JMP Wish List to make sure it gets directly to the JMP developers
Jim
gzmorgan0
Super User (Alumni)

Re: Change the default color of box plot lines

@PCameh ,

 

You can create a custom Oneway UI.  Try the script below, it calls up the built-in Oneway dialog.  For this script, as long as there are 10 or less category groups all the boxplots will be black. If Big Class.jmp is the current data table and you run this script, use Height and Weight for Y, age for X and sex by BY all your boxplots will be black.  

 

If the JMP table Semiconductor Capability.jmp is the current table and you run this script, use numerous process variables as Y and lot_id as X,

the first 10 boxplots  are black, however, there are 13 lot_id's.

 

Off the top of my head, I do not have alternate syntax to make this truly flexible. So, one option is to modify this script to accommodate a large number of category values, maybe 100. Then save this script to your main menu, maybe call it my Oneway. Note you can also customize the line width, etc with a few edits to the script.

 

 

Oneway(
	Box Plots( 1 ),
	X Axis Proportional( 0 ),
	Points Jittered( 1 ),
	
	SendToReport(

		Dispatch(
			{},
			"Oneway Plot",
			FrameBox,
			{DispatchSeg( Box Plot Seg( 1 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 2 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 3 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 4 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 5 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 6 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 7 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 8 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 9 ), Confidence Diamond( 0 ), Set Line Color("Black") ),
			DispatchSeg( Box Plot Seg( 10 ), Confidence Diamond( 0 ), Set Line Color("Black") )
			}		
	)
  )
);
gzmorgan0
Super User (Alumni)

Re: Change the default color of box plot lines

ps. I agree with @txnelson, being able to set a preferences for a platform BoxPlotSeg would be very nice. 

 

Also, a JSL Dispatch that would allow  a single DispatchSeg( BoxPlotSeg(*), etc.)   or DispatchAllSeg( BoxPlotSeg, etc.) would be a nice solution as well.

PCameh
Level II

Re: Change the default color of box plot lines

A million thanks @gzmorgan0!! This is a life-saver hack! I copied your script and replicated the DispatchSeg another 90 times, for a total 100 like you suggested and it works like a charm now! I changed the hotkey to this addin instead of the default JMP Oneway function, and I can't even tell the difference now. 

 

You're the MVP!! Thanks a lot again!

rbfinner
Level III

Re: Change the default color of box plot lines

Just implemented the same solution for boxplots in variability charts. I find it makes a big impact, improves legibility, and really helps to highlight differences between groups

Re: Change the default color of box plot lines

Can you share the script for boxplots in variability chart? I am unable to make it happen. Thanks for your help!

hogi
Level XII

Re: Change the default color of box plot lines

Following the idea of @gzmorgan0 

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
	
myPlot = Variability Chart(
	Y( :height ),
	X( :age ),
	Variability Analysis( :height, 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")  

hogi_0-1717446275882.png