turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- How do I plot multiple control charts on the same ...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 25, 2015 5:43 AM
(3050 views)

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.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 25, 2015 9:45 AM
(4142 views)

Solution

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 );
```

-Jeff

7 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 25, 2015 6:24 AM
(2573 views)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 25, 2015 7:43 AM
(2573 views)

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:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 25, 2015 8:30 AM
(2573 views)

Perhaps you can try.....Analyze>Quality and Process>Control,Chart>IR and then group by Machine.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 25, 2015 8:11 AM
(2573 views)

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);
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 25, 2015 8:27 AM
(2573 views)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 25, 2015 9:45 AM
(4143 views)

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 );
```

-Jeff

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 26, 2015 1:14 AM
(2573 views)

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.