Minitab macro vs. Layout tool

M

MiniNik

#1
Hello everybody,
I'm new in here and glad, that i've found this forum.
you will hardly believe it, but i'm here because i have a problem and i hope, you can give me some good advices.:)
My plan is to write a macro for minitab. This worked out quite fine, but now i have quite a lot of graphs in my analysis. I want to reduce the number of open windows and therefore to fit four different graphs (eg Histogram, NormTest) in one window. I know there is the layout tool for the manual way, but what can i do to get this or an similair function in my macro to implement the four graphs into one window automatically?
I hope, you can give me some valuable tips.
kind regards, :bigwave:

MiniNik
 
Elsmar Forum Sponsor
A

Allattar

#2
Within the macro you need to open a layout, and at the end use endlayout to close it. The resulting graphs are then put on the layout page.

Heres an Example

LAYOUT;
TITLE "name the layout".


Histogram C1;
YFrequency;
Bar;
FIGURE 0 0.5 0 0.5.

Boxplot C1;
IQRBox;
Outlier;
FIGURE 0 0.5 0.5 1.

TSPlot C1;
Symbol;
Connect;
FIGURE 0.5 1 0 0.5.

XbarChart C1 5;
FIGURE 0.5 1 0.5 1.

ENDLAYOUT

Highlighted in the above are the commands you really need to use. The figure subcommand can be added to a graph to position the graph on the page, the structure of the subcommand is
figure Xstart Xend Ystart Yend.

The X axis starts at 0 on the left, and ends with 1 on the right hand edge of the page.
The Y axis starts at 0 on the bottom of the page and ends at 1 at the top of the page.

Thats it :D, your lucky as this issue came up for me just last week.
 
M

MiniNik

#3
Thanks a lot.
But i'm getting the next error message:

"Histogram C3;
YFrequency;
Bar;
FIGURE 0 0.5 0 0.5.

* ERROR * Extra text is not allowed.

* Remaining subcommands ignored. "

The following i had written in the command line editor:

"LAYOUT;
TITLE "Histogram".
Histogram C3;
YFrequency;
Bar;
FIGURE 0 0.5 0 0.5.
Boxplot C3;
IQRBox;
Outlier;
FIGURE 0 0.5 0.5 1.
TSPlot C3;
Symbol;
Connect;
FIGURE 0.5 1 0 0.5.
XbarChart C3 5;
FIGURE 0.5 1 0.5 1.
ENDLAYOUT"

Any idea what's wrong? :eek: :truce:
 
A

Allattar

#4
Works here when I test it.
Which version of Minitab do you have, these commands run in release 15. I am trying to remember if those layout commands where in release 14 or not, but I never tried to use them in 14.

What are your regional settings?
Commands in the command line editor can go a bit odd if your regional settings are using different values as list or numeric seperators. I think they should work ok in a global macro though.

EDIT:
Got it, I read your public profile, your location is Germany, and hence your decimal seperator is ,

Change the commands to.

"LAYOUT;
TITLE "Histogram".
Histogram C3;
YFrequency;
Bar;
FIGURE 0 0,5 0 0,5.
Boxplot C3;
IQRBox;
Outlier;
FIGURE 0 0,5 0,5 1.
TSPlot C3;
Symbol;
Connect;
FIGURE 0,5 1 0 0,5.
XbarChart C3 5;
FIGURE 0,5 1 0,5 1.
ENDLAYOUT"
 
M

MiniNik

#5
Minitab release 14.20 installed.
Ok, i've just read your edit... :biglaugh::magic::bonk:i although had to see that with point vs comma.


That was a very easy solution to the error message. Tank you veeeerrry verryyy much, it works, great, wonderful, beautiful, absolutely fantastic!!!:thanks::thanx::applause:*chapeau* i hope, i can help you the next time, but sadly i've just begun working with macros, so it could last a little time... :p
 
M

MiniNik

#6
Another question:

Error Message:

Capa 'C2' 1;
Mu 19;
Lspec 16,2;
Uspec 21,9;
Pooled;
AMR;
UnBiased;
Toler 6;
Within;
Overall;
CStat;
FIGURE 0 0,5 0 0,5.
* Completion of computation impossible.

Can me anybody tell what's wrong with this? :confused:

My input was:

"LAYOUT;
TITLE "Data analysis C2".
Capa 'C2' 1;
Mu 19;
Lspec 16,2;
Uspec 21,9;
Pooled;
AMR;
UnBiased;
Toler 6;
Within;
Overall;
CStat;
FIGURE 0 0,5 0 0,5.
Boxplot C3;
IQRBox;
Outlier;
FIGURE 0 0,5 0,5 1.
TSPlot C3;
Symbol;
Connect;
FIGURE 0,5 1 0 0,5.
XbarChart C3 5;
FIGURE 0,5 1 0,5 1.
ENDLAYOUT"
 
A

Allattar

#7
Glad it works, wasnt sure that the layout command was in 14. (as opposed to layout on the menu)

It looks to me that the column C2 is enclosed with single quotes. Single quotes refer to column names, not numbers so it should be

CAPA c2 1;

But heres the other thing, the figure command doesnt work with the capability command. I think its an issue of non updating graphs, I even tried the DATA subcommand which works to reposition the data region on a graph.

eg: DATA xstart xend ystart yend is used to position the data part of the graph in the graph region, where figure places the grah region on the page.

Capa doesnt like that either.

It may be easier to use the Histogram command, and add reference lines to the histogram instead.

Heres a neat trick, create a histogram, add reference lines from the right click menu. Then go to editor and copy command language, the editing you made to the chart is copied with the commands so you can paste it into the macro.


So unless anyone knows of any other commands that will reposition the graph, capability on that layout might be difficult from the capa command.

I have found a method though of building the capability measures from the capa command back into another graph.
You have to store the information you want, like Cpk.
Convert the value to a text column
text c10 c10
Store the text column in a constant
let k1 = c10(1)
Write the constant as a text table in the graph.

using a subcommand of
text -5 30 k1
With a graph command will add the cpk written to the worksheet onto the graph at coordinates -5 30.

I use that copy command language trick to find the commands I want and then play with the positioning.
 
M

MiniNik

#8
thank you for your information. when you don't know it, you can drive yourself crazy on the try to find a solution for this...:mad::biglaugh:
 
M

MiniNik

#9
hmmmm... it's annoying that many other plots aren't adaptable automaticly. Isn't it possible to write in a macro: click this button then click this and so on? If so: How can i get the program invocations (especially from the layout-tool)?
 
Last edited by a moderator:
C

candid

#10
Naming the created "LAYOUT" graph..?

Hello,

I have some macros that I run quite often that grabs data from our database, puts up some nice layouts..

Now when I plan to make this public, and let other people start using it themselfs, first problem I ran into was that all the Layouts created in the "Graph folder" are ALL called LAYOUT..

Can i within the Layout command, add something to name the Graph?
I am not talking about the small Titles, those I have figured out.

Here is one of my Layout commands:

LAYOUT;
TITLE "OP60 M3".
XbarChart 'BEN1_OP60M3 (mm)' 10;
Stamp 'BEN1_TID';
Test 1 2 3;
FIGURE 0 0,33 0,5 1.
XbarChart 'BEN2_OP60M3 (mm)' 10;
Stamp 'BEN2_TID';
Test 1 2 3;
FIGURE 0,33 0,67 0,5 1.
XbarChart 'BEN3_OP60M3 (mm)' 10;
Stamp 'BEN3_TID';
Test 1 2 3;
FIGURE 0,67 1 0,5 1.
XbarChart 'BEN4_OP60M3 (mm)' 10;
Stamp 'BEN4_TID';
Test 1 2 3;
FIGURE 0 0,33 0 0,5.
XbarChart 'BEN5_OP60M3 (mm)' 10;
Stamp 'BEN5_TID';
Test 1 2 3;
FIGURE 0,33 0,67 0 0,5.
XbarChart 'BEN6_OP60M3 (mm)' 10;
Stamp 'BEN6_TID';
Test 1 2 3;
FIGURE 0,67 1 0 0,5.
ENDLAYOUT

Apreciative for any help or tips !:frust:
 
Thread starter Similar threads Forum Replies Date
V Minitab GRR crossed Xbar and r method macro needed Using Minitab Software 9
D minitab macro to pull access query with parameters Using Minitab Software 1
V Validation of macro - scripts - programs used in statistical software (Minitab-SAS... Qualification and Validation (including 21 CFR Part 11) 5
F Run Minitab Macro from Excel Using Minitab Software 3
M Minitab macro to add reference line to graph Using Minitab Software 1
M Writing a Minitab macro that can manipulate data in all columns Using Minitab Software 3
M Insert Empty Column Using Minitab Macro Using Minitab Software 2
B Minitab R14 macro for Power Analysis Using Minitab Software 1
T Minitab - Getting a Minitab Macro to look up a Column Name Using Minitab Software 23
M Minitab Macro-Command 'NUMERIC' to convert a text column to an numeric column Using Minitab Software 8
M Minitab 15 - READ, SET from keyboard or file doesn't work in my macro Using Minitab Software 4
J RANCOVA (rank ANCOVA) macro for minitab Using Minitab Software 2
M Problem creating a Macro in Minitab Using Minitab Software 4
M Macro to connect to Access Database to get to data - Minitab Macro help Using Minitab Software 1
M Macro that will perform a normality test and capability analysis - Minitab help Using Minitab Software 1
T Minitab Coding Help Using Minitab Software 0
B Minitab factorial design regression equation center point term Manufacturing and Related Processes 1
G Acceptance sampling by variables - Do Minitab use one sided k only? Why? Statistical Analysis Tools, Techniques and SPC 0
C. Tejeda Computer system validation approach for Minitab Statistical software Software Quality Assurance 11
Z Setting the Control limits on Minitab Using Minitab Software 4
T Poisson regression using Minitab Statistical Analysis Tools, Techniques and SPC 3
I Excel based Gage R&R VS Minitab calculation Gage R&R (GR&R) and MSA (Measurement Systems Analysis) 5
R Select the 1 Supplier based on the Parts Durability from 6 Supplier Samples using Minitab Using Minitab Software 11
A One-factor and multiple-response Minitab optimization Using Minitab Software 2
O Problem in Minitab - ERROR * Factor Voltage is highly correlated with other terms Using Minitab Software 10
F Minitab 19 Anova or X bar # of distinct catagories Using Minitab Software 2
P Pooled Standard Error - Minitab Statistical Analysis Tools, Techniques and SPC 0
S Asterisk in DOE minitab software Using Minitab Software 23
B Does anybody know how to get older versions of Minitab to work in Windows 10? Quality Tools, Improvement and Analysis 9
M Minitab Capability of the Population (no sampling) Using Minitab Software 11
Z Minitab - Updating Graph with specific data points Using Minitab Software 2
S Need help with analysing a survey on minitab Using Minitab Software 1
M Minitab assistant: 1-Sample % Defective Test Using Minitab Software 1
0 Interesting Discussion Analysis of half normal distribution in minitab Using Minitab Software 11
G Batch printing reports in Minitab Using Minitab Software 3
B Minitab Type 1 Gage Study on True Position Question Measurement Uncertainty (MU) 1
I Number of decimals in equation calculated by MiniTab Using Minitab Software 0
A Acceptance p-value for linearity and bias analysis in minitab results Gage R&R (GR&R) and MSA (Measurement Systems Analysis) 0
M How to change the display of optimization plot in Minitab 18 Using Minitab Software 2
M Minitab tool to evaluate PM (Preventive Maintenance) process Using Minitab Software 6
E Input to ANOVA 1-WAY - How can I perform this analysis in minitab? Using Minitab Software 2
N Tolerance Interval plots in Minitab Statistical Analysis Tools, Techniques and SPC 0
J Including Repeats in DoE using Minitab Using Minitab Software 5
A Minitab 18: How to automate GRR Summary Table save Reliability Analysis - Predictions, Testing and Standards 1
N What subcommands can be used with "Stop" in Minitab 18? Using Minitab Software 8
S Minitab - Factor Analysis: Label on second series of data for Biplot Using Minitab Software 4
J Which Anova dropdown to use for R&R in Minitab? Gage R&R (GR&R) and MSA (Measurement Systems Analysis) 1
J DoE - Number of runs in Plackett-Burman (Minitab) Using Minitab Software 2
D Asterix when pasting a column of values from Excel into Minitab (V17) Using Minitab Software 5
A Generating samples from a population in Minitab Using Minitab Software 0

Similar threads

Top Bottom