|
|
 |
|

28th August 2008, 08:41 AM
|
|
Inactive Registered Visitor
Registration Date: Aug 2008
Location: Germany
|
|
Posts: 6
Thanks Given to Others: 2
Thanked 1 Time in 1 Post
Karma Power: 6 Karma: 12 
|
|
Minitab macro vs. Layout tool
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,
MiniNik
|

28th August 2008, 09:29 AM
|
|
Involved in Discussions
Registration Date: Jan 2008
Location: UK
|
|
Posts: 97
Thanks Given to Others: 4
Thanked 45 Times in 35 Posts
Karma Power: 19
|
|
Re: Minitab macro vs. Layout tool
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  , your lucky as this issue came up for me just last week.
|

28th August 2008, 10:53 AM
|
|
Inactive Registered Visitor
Registration Date: Aug 2008
Location: Germany
|
|
Posts: 6
Thanks Given to Others: 2
Thanked 1 Time in 1 Post
Karma Power: 6 Karma: 12 
|
|
Re: Minitab macro vs. Layout tool
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?
|

28th August 2008, 11:00 AM
|
|
Involved in Discussions
Registration Date: Jan 2008
Location: UK
|
|
Posts: 97
Thanks Given to Others: 4
Thanked 45 Times in 35 Posts
Karma Power: 19
|
|
Re: Minitab macro vs. Layout tool
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"
|
|
Thanks to Allattar for your informative Post and/or Attachment!
|
|

28th August 2008, 11:21 AM
|
|
Inactive Registered Visitor
Registration Date: Aug 2008
Location: Germany
|
|
Posts: 6
Thanks Given to Others: 2
Thanked 1 Time in 1 Post
Karma Power: 6 Karma: 12 
|
|
Re: Minitab macro vs. Layout tool
Minitab release 14.20 installed.
Ok, i've just read your edit...    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!!!    *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
|

28th August 2008, 12:14 PM
|
|
Inactive Registered Visitor
Registration Date: Aug 2008
Location: Germany
|
|
Posts: 6
Thanks Given to Others: 2
Thanked 1 Time in 1 Post
Karma Power: 6 Karma: 12 
|
|
Re: Minitab macro vs. Layout tool
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?
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"
|

28th August 2008, 12:37 PM
|
|
Involved in Discussions
Registration Date: Jan 2008
Location: UK
|
|
Posts: 97
Thanks Given to Others: 4
Thanked 45 Times in 35 Posts
Karma Power: 19
|
|
Re: Minitab macro vs. Layout tool
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.
|
|
Thanks to Allattar for your informative Post and/or Attachment!
|
|

1st September 2008, 05:04 AM
|
|
Inactive Registered Visitor
Registration Date: Aug 2008
Location: Germany
|
|
Posts: 6
Thanks Given to Others: 2
Thanked 1 Time in 1 Post
Karma Power: 6 Karma: 12 
|
|
Re: Minitab macro vs. Layout tool
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... 
|
|
Thanks to MiniNik for your informative Post and/or Attachment!
|
|
Lower Navigation Bar
|
|
|
|
Visitors Currently Viewing this Thread: 1 (0 Registered Visitors and 1 Unregistered Guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate Thread Content |
Linear Mode
|
|
Posting Settings
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|