1. This is dataplot macro     annotate_boxplot_subplot.dp     10/9/18
2. Purpose: For a given subplot within the DEX 10-step step 5 box plots, annotate the subplot:
3.             1. write out the within-subplot primary factor designation
4.             2. write out the robustness factor settings below the horizontal axis
5.             3. for the lower left corner subplot only, write out the vertical and horizontal axis labels.
6.          below the horizontal axis of a single sub-plot
7.          for the multiplot for step 5 of the DEX 10-step analysis.
8. Date: 10/9/18
9. Input:
10.   k                   (parameter)  = number of factors
11.   primj               (parameter)  = primary factor ID
12.   jrob1, jrob2, jrob3 (parameters) = the 3 robustness factor settings
13.   leftcorn            (parameter)  = the primj ID of the lower left corner subplot
14.   xplot               (vector)     = automatic horizontal axis values (from existing plot)
15
16.
17. Note: it is assumed that a mean block plot sub-plot has already been plotted out
18.
19. -----start point-----
20.
21let bugswwrf = 1
22. let pausesw = 1
23.
24.
25. -----Step 1: Within each subplot, write out the within-subplot primary factor ID in upper left corner-----
26.
27just left
28let xp = 17; let yp = 81.5; hw 4 2
29if         k > 16 and k <= 20; let xp = 17; let yp = 81.5; hw 4 2
30   else if k > 12 and k <= 16; let xp = 17; let yp = 80.0; hw 4 2
31   else if k > 9 and k <= 12;  let xp = 17; let yp = 81.5; hw 4 2
32   else if k > 6 and k <= 9;   let xp = 17; let yp = 81.5; hw 4 2
33   else if k > 4 and k <= 6;   let xp = 17; let yp = 83.5; hw 4 2
34   else if k <= 4;             let xp = 17; let yp = 83.5; hw 4 2
35end if
36
37move xp yp
38if cx^jprim not exist ; text X^jprim            ; end if
39if cx^jprim     exists; text X^jprim (^cx^jprim); end if
40.
41. -----Step 2.1: From the existing subplot, determine the data-units x-positions of the 8 blocks-----
42.
43. print yplot xplot tagplot
44.
45skip 0
46let xpv = xplot
47retain xpv subset tagplot < 99 subset tagplot 1
48. print xpv
49. pause
50.
51. -----Step 2.2: For each of the 3 robustness factors, write out the 8 -'s or +'s-----
52.
53hw 4 2; just center
54if k >= 12; hw 2.8 1.4; end if
55.
56let yp1 = 13; let yp2 = 7; let yp3 = 1
57if k >= 12; let yp1 = 12; let yp2 = 6; let yp3 = 0; end if
58.
59let nxpv = number xpv
60.
61if k = 3 or n = 8
62   loop for j = 1 1 nxpv
63      let xpvj = xpv(j)
64      let string stout = -; color blue
65      if j = 3 4; let string stout = +; color red; end if
66      moveds xpvj yp1;  text ^stout
67      let string stout = -; color blue
68      if j = 2 4; let string stout = +; color red; end if
69      moveds xpvj yp2;  text ^stout
70   end loop
71end if
72.
73if k >= 4 and n >= 16
74   loop for j = 1 1 nxpv
75      let xpvj = xpv(j)
76      let string stout = -; color blue
77      if j = 5 6 7 8; let string stout = +; color red; end if
78      moveds xpvj yp1;  text ^stout
79      let string stout = -; color blue
80      if j = 3 4 7 8; let string stout = +; color red; end if
81      moveds xpvj yp2;  text ^stout
82      let string stout = -; color blue
83      if j = 2 4 6 8; let string stout = +; color red; end if
84      moveds xpvj yp3;  text ^stout
85   end loop
86end if
87.
88. -----Step 2.3: For each of the 3 robustness factors, write out the factor ID's-----
89.
90hw 4 2; just right; color blue
91if k >= 12; hw 2.8 1.4; end if
92let xp = 21
93move xp yp1; text X^jrob1&:
94move xp yp2; text X^jrob2&:
95if k >= 4 and n >= 16; move xp yp3; text X^jrob3&:; end if
96.
97. -----Step 3: For the lower left corner subplot only, write out the vertical and horizontal axis text-----
98.
99if jprim = leftcorn
100   let vxp = -5;     let vyp = 55; let hxp = 50; let hyp = -10;
101   if         k > 16 and k <= 20;
102                     let vxp = -5; let vyp = 55; let hxp = 50; let hyp = -10;
103      else if k > 12 and k <= 16;
104                     let vxp = -5; let vyp = 55; let hxp = 50; let hyp = -10;
105      else if k > 9  and k <= 12;
106                     let vxp = -12; let vyp = 55; let hxp = 50; let hyp = -10;
107      else if k > 6  and k <= 9;
108                     let vxp = -5; let vyp = 55; let hxp = 50; let hyp = -10;
109      else if k > 4  and k <= 6;
110                     let vxp = -5; let vyp = 55; let hxp = 50; let hyp = -10;
111      else if k <= 4;
112                     let vxp = -5; let vyp = 55; let hxp = 50; let hyp = -5;
113   end if
114   .
115   delete yjunk; let yjunk = y
116   let yjunk = abs(yjunk)
117   let numb = maximum yjunk
118   call number_of_digits.dp
119   let numint3 = 3*numint
120   let vxp = -numint3 - 2
121   if k <= 4; let vxp = -numint3 + 2; end if
122   . print numb numint numint3 vxp
123   . pause
124   .
125   if cy not exist; let string stout = Mean Y      ; end if
126   if cy exists   ; let string stout = Mean Y (^cy); end if
127   move vxp vyp; just center; direction vertical; text ^stout
128   direction horizontal
129   .
130   move hxp hyp; just center; text Robustness Factor Setting
131end if
132.
133
134
135