Automating a Time Series Plot


In this session we shall use Minitab® to

In the Minitab tutorial #4 (coin toss example), the lengthy block of command and subcommands,

### Plot the relative frequency as a time series plot: 
Tsplot 'Rel.Freq.';
  Scale 2;
    MODEL 1;
      Tick 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7;
      Min 0.3;
      Max 0.7;
    EndMODEL;
  AxLabel 1;
    ADisplay 1;
    Label "# coins";
      ALevel 1;
  Index;
  Connect;
  Symbol;
    Type 0;
    Size 0.7;
  Grid 2;
  Title "ENGI 3423 Empirical Probability";
  SubTitle "Coin Tossing Experiment";
  Footnote;
    FPanel;
  NoDTitle.
was generated as follows.

First, execute a version of the Coins macro that does not include the Tsplot command shown above.

The results of the cointoss simulation
should appear in the worksheet window.

  [screenshot]


On the main menu bar,
click on "Graph",
then on "Time Series Plot...".

  [screenshot]



[screenshot]  

Accept the default "Simple".

Just click "OK".



This dialog box window opens.
[screenshot]

In the large variables pane at the left, double click on the variable "C3".
It should appear in the upper right pane "Series".
Click on the "Time/Scale..." button.


Click on the third tab "Gridlines".
Check the top box "Y major ticks".
The other tabs allow other customization.   Ignore them for now.

[screenshot]

Click "OK".


Click on the "Labels" button of the main "Time Series Plot - Simple" dialog box.

On the new dialog box, ensure that the first tab "Titles/Footnotes" is active.
Enter appropriate text in the title box(es).

[screenshot]

Click "OK" on this dialog box.
Click "OK" on the main "Time Series Plot - Simple" dialog box.


Our time series plot looks like this:

[screenshot]

We need to tidy this graph up.

The hundreds of red plotted points are overlapping each other and are obscuring the blue connecting lines.

We also wish to restrict our attention to ranges of relative frequency closer to 0.5 .
The interval [0.3, 0.7] is appropriate.

We need to keep a record of the amendments that we make.
Save your work, click anywhere on the graph, then

[screenshot]  

On the menu bar,
click on "Editor".

In the drop down menu,
click on "Copy Command Language"

The text of all commands will be copied to the clipboard.

Click on the graph window to bring it to the top again.



Double-click on any number by the vertical axis.


[screenshot]  

On the first tab "Scale",
in the upper group
    "Major Tick Positions",
click on the third radio button,
    "Position of ticks".

Amend the numbers in the text box as shown.

In the lower left group
    "Scale Range",
uncheck both boxes and
change "Minimum" to 0.3 and
change "Maximum" to 0.7 .

Other features can be modified on the other tabs, (not shown here).

Click the "OK" button.



Double-click on the horizontal axis label "Index".


In the "Edit Axis Label" dialog box:
On the first tab "Font",

in the lowest text box,
change the text as shown.

Click the "OK" button.

  [screenshot]


Double-click anywhere on the red curve on the graph.


[screenshot]  

On the first tab "Attributes",
click the radio button "Custom:".

Click the down arrow beside "Type",
scroll up to the top
and click on "None".

This will suppress the plotting of the red symbols, so that only the blue connecting lines will be plotted.

Click the "OK" button.



Your graph should have a similar format to the one shown here.

[screenshot]


To incorporate all of these options into the macro, open Notepad,
paste the clipboard into the blank document and
save it with some appropriate file name.

You can then copy and paste this text onto the end of your previous macro that generated the data for the time series plot.

Save the macro.   It should now be as shown near the top of this web page.


  [Return to the cointoss example]
  [Return to the index of demonstration files]
  [Return to your previous page]

Created 2003 03 26 and most recently modified 2007 07 04 by Dr. G.H. George