Hi everyone,
I'm a new JMP user and I have some difficulties to plot multiple control charts on the same report.
Here is my problem:
I am actually simulating a workshop that fills bottles for a fizzy drink. 3 steps are required on the process:
- a step where a concentrated solution is added
- then the solution is diluted with water
- and at the end, gas is added
For each step of this process, there are different machines. Thus, I have:
- "Concentré M1", "Concentré M2" and "Concentré M3" that can add the concentrated solution
- "Eau M4", "Eau M5" and "Eau M6" that can dilute the solution with water
- "Gaz M7", "Gaz M8" and "Gaz M9" that can add gas to the solution.
I would like to have a picture with 3 control charts, one for each "Concentrated Machines".
Here is my code:
par =
Control Chart(
Sample Label( :date ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col(
:Volume,
Individual Measurement( Avg( 0 ), LCL( -0.8 ), UCL( 0.8 ) )
),
By( :concentre )
);
rpar = par << report;
rpar << save picture( "C:\Users\ThaiBinh\Desktop\cc-concentre.png", png );
When I run this program, my 3 control charts are plotted but when I open my picture on the desktop, I only have the last control chart. Here is what I have:
Can someone explain me how to obtain the 3 different control charts on the same picture ?
Thank you for your help !
NB: You will find attached the table that contains the data that I need to analyse.
The reason that your original code didn't work is because rpar is a list of Control Chart platforms, one for each by group.
dt = Open( "$SAMPLE_DATA\Quality Control\Diameter.jmp" );
rpar = dt << Control Chart(
Sample Label( :DAY ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :DIAMETER, Individual Measurement, Moving Range ),
By( :MACHINE )
);
Show( rpar );
/*: rpar = {Control Chart[], Control Chart[], Control Chart[]};
So, to the whole report windows, you'll need to get the report object for the first platform and then get a reference to its parent and save that as a picture.
dt = Open( "$SAMPLE_DATA\Quality Control\Diameter.jmp" );
rpar = dt << Control Chart(
Sample Label( :DAY ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :DIAMETER, Individual Measurement, Moving Range ),
By( :MACHINE )
);
Show( rpar );
reportparent = rpar[1] << parent();
reportparent << save picture( "~\Desktop\cc-concentre.png", png );
LouV's pointer to the Control Chart Builder platform is a good one also, even if you can't use the Phase column. You can use the By() statement. Over the next releases we will likely be deprecating the other Control Chart platform in favor of the Control Chart Builder.
Here's the same code using Control Chart Builder. The saving of the graphs works the same way.
dt = Open( "$SAMPLE_DATA\Quality Control\Diameter.jmp" );
rpar = dt << Control Chart Builder(
Show Control Panel( 0 ),
Show Capability( 0 ),
Variables( Y( :DIAMETER ) ),
Chart( Position( 1 ) ),
Chart( Position( 2 ) ),
By( :MACHINE )
);
Show( rpar );
reportparent= rpar[1] << parent();
reportparent << save picture( "~\Desktop\cc-concentre.png", png );
Have you tried Analyze>Quality and Process>Control Chart Builder and then use Phase to capture the different machines.
Thank you LouV for your answer.
I tried your method and it works. However, those control charts are intended to people who are not specialized in SPC. And in your graph, it is not very clear that 3 machines were used to plot this control chart.
I really want to have 3 seperate control charts, something like this:
Perhaps you can try.....Analyze>Quality and Process>Control,Chart>IR and then group by Machine.
LouV's solution is a good one and makes comparison much easier. One way to directly answer your question:
1. Create a journal window.
2. Wrap your control chart code in an expression.
3. Send the expression to the Journal.
4. Save the journal as a picture.
The code is:
rwin = NewWindow("Picture Output", <<journal);
par = Expr(
Control Chart(
Sample Label( :date ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col(
:Volume,
Individual Measurement( Avg( 0 ), LCL( -0.8 ), UCL( 0.8 ) )
),
By( :concentre )
)
);
Current Journal()<<Append(par);
rwin << Save Picture("C:\Users\ThaiBinh\Desktop\cc-concentre.png", png);
What about just creating your charts natively in JMP and then executing a File -> Save As -> and save the report as a .jpeg file? One picture file then holds everything.
The reason that your original code didn't work is because rpar is a list of Control Chart platforms, one for each by group.
dt = Open( "$SAMPLE_DATA\Quality Control\Diameter.jmp" );
rpar = dt << Control Chart(
Sample Label( :DAY ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :DIAMETER, Individual Measurement, Moving Range ),
By( :MACHINE )
);
Show( rpar );
/*: rpar = {Control Chart[], Control Chart[], Control Chart[]};
So, to the whole report windows, you'll need to get the report object for the first platform and then get a reference to its parent and save that as a picture.
dt = Open( "$SAMPLE_DATA\Quality Control\Diameter.jmp" );
rpar = dt << Control Chart(
Sample Label( :DAY ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :DIAMETER, Individual Measurement, Moving Range ),
By( :MACHINE )
);
Show( rpar );
reportparent = rpar[1] << parent();
reportparent << save picture( "~\Desktop\cc-concentre.png", png );
LouV's pointer to the Control Chart Builder platform is a good one also, even if you can't use the Phase column. You can use the By() statement. Over the next releases we will likely be deprecating the other Control Chart platform in favor of the Control Chart Builder.
Here's the same code using Control Chart Builder. The saving of the graphs works the same way.
dt = Open( "$SAMPLE_DATA\Quality Control\Diameter.jmp" );
rpar = dt << Control Chart Builder(
Show Control Panel( 0 ),
Show Capability( 0 ),
Variables( Y( :DIAMETER ) ),
Chart( Position( 1 ) ),
Chart( Position( 2 ) ),
By( :MACHINE )
);
Show( rpar );
reportparent= rpar[1] << parent();
reportparent << save picture( "~\Desktop\cc-concentre.png", png );
Hello and thank you to everybody for your answers.
I tried your different scripts and it works perfectly !
So once again thanks for your answers.
Have a good day,
Thai-Binh Nguyen.