- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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:
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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") )
}
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change the default color of box plot lines
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change the default color of box plot lines
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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") )
}
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change the default color of box plot lines
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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")