<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hello,
I'm trying to change the color of a specific cause in the Pareto Plot using JSL. How can I select a cause by name?
For example, I want to implement something like this:
cause ({"PASS"}) << Colors (Green);
This gives me an error and wants me to use Causewhere n is the index of the failure pareto. My issue is that I won't know if my PASS pareto will be #1, #2, etc.
Any suggestions?
Here is my code below:
dt << Pareto Plot(
Cause( :BinName),
Colors (Red),
SendToReport(
Dispatch( {}, "Pareto Plot", OutlineBox, {Set Title( "Pareto of " || (dt << Get Name) )} ),
Dispatch( {"Plots"}, "102", ScaleBox, {Label Row( Show Major Grid( 1 ) )} )
)
)
Shin
Hi Wendy,
That was perfect. Thanks for the solution.
Shin
Hi, Shin.
The following example demonstrates how you can determine the index and color a specific cause by name:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Failure Raw Data.jmp" );
/* Obtain the sorted frequency */
dtSumm = dt << Summary( Group( :failure ), private );
dtSumm << Sort( By( :N Rows ), Order( Descending ), Replace Table );
/* Obtain the row number for the desired cause specified by name */
r = (dtSumm << Get Rows Where( :Failure == "oxide defect" ))[1];
/* Generate the Pareto Plot */
pPlot = dt << Pareto Plot(
Cause( :Failure ),
Colors( "Red" ),
/* Set the color for the desired cause */
Cause[r] << Colors( "Green" ),
SendToReport(
Dispatch(
{},
"Pareto Plot",
OutlineBox,
{Set Title( "Pareto of " || (dt << Get Name) )}
),
Dispatch( {"Plots"}, "102", ScaleBox, {Label Row( Show Major Grid( 1 ) )} )
)
);
I hope this helps.
Wendy