title: Relabel using grc1leg
body: <p>I am trying to show four different graph plots in one illustration. I am using the <em>community-contributed</em> command <code>grc1leg</code>.
  However, if I use <code>relabel</code> in each separate graph the command grc1leg does not recognise the changes.</p>
  
  <p>An example of my data is:</p>
  
  <pre><code>+---------+----------+------------+----+----+----+----+
  | student | matutino | vespertino | p6 | p7 | p8 | p9 |
  +---------+----------+------------+----+----+----+----+
  | 1       | 1        | 0          | 1  | 3  | 4  | 3  |
  +---------+----------+------------+----+----+----+----+
  | 2       | 1        | 0          | 2  | 5  | 1  | 2  |
  +---------+----------+------------+----+----+----+----+
  | 3       | 0        | 1          | 2  | 2  | 6  | 2  |
  +---------+----------+------------+----+----+----+----+
  </code></pre>
  
  <p>Variable <code>Matutino</code> is a dummy of whether the student attends morning classes.</p>
  
  <p>Variable <code>Vespertino</code> is a dummy of whether the student attends afternoon classes.</p>
  
  <p>Variable <code>p6</code> refers to question 6 which asks if the student works and it takes two values: <code>1</code> and <code>2</code></p>
  
  <p>Variable <code>p7</code> asks how long the student has been working and it takes six values: <code>1,2,3,4,5,6</code></p>
  
  <p>Variables <code>p8</code> and <code>p9</code> are just like <code>p7</code>.</p>
  
  <p>My data is coded in numerical form, however it represents string answers from a survey. I want to have in the <code>x-axis</code> of graphs the string names instead of the numerical code.</p>
  
  <p>My code is the following:</p>
  
  <pre><code>graph bar (percent) matutino (percent) vespertino, over (p6,relabel (1 "Si" 2 "No")) name(p6, replace) title("¿Trabajas actualmente?") nolabel
  graph bar (percent) matutino (percent) vespertino, over (p7,relabel (1 "0-1" 2 "1-5" 3 "6-11" 4 "12-24" 5 "más de 24")) name(p7, replace) title ("Tiempo trabajando") legend(off) b1title("Meses")
  graph bar (percent) matutino (percent) vespertino, over (p8,relabel (1 "1-3" 2 "4-6" 3 "7-9" 4 "10-12" 5 "13-15" 6 "16-18" 7 "19-21" 8 "22-24" 9 "más de 25")) name(p8, replace) title ("Horas trabajadas a la semana") legend(off) b1title("Horas")
  graph bar (percent) matutino (percent) vespertino, over (p9,relabel (1 "Independencia" 2 "Gastos personales" 3 "Continuar estudiando" 4 "Experiencia laboral" 5 "Mantener a la familia" 6 "Ayuda en el negocio familiar") label (labsize(small) angle(45))) name(p9, replace) title ("Motivo para trabajar") legend(off)
  grc1leg p6 p7 p8 p9, l1(Porcentaje) legendfrom(p6)
  </code></pre>
  
  <p>The code works perfectly for each graph separately, for example:</p>
  
  <pre><code>graph bar (percent) matutino (percent) vespertino, over (p7,relabel (1 "0-1" 2 "1-5" 3 "6-11" 4 "12-24" 5 "más de 24")) name(p7, replace) title ("Tiempo trabajando") legend(off) b1title("Meses")
  </code></pre>
  
  <p>And the code also works when I combine the four graphs but without the relabel option, for example:</p>
  
  <pre><code>graph bar (percent) matutino (percent) vespertino, over (p6) name(p6, replace) title("¿Trabajas actualmente?") nolabel
  graph bar (percent) matutino (percent) vespertino, over (p7) name(p7, replace) title ("Tiempo trabajando") legend(off) b1title("Meses")
  graph bar (percent) matutino (percent) vespertino, over (p8) name(p8, replace) title ("Horas trabajadas a la semana") legend(off) b1title("Horas")
  graph bar (percent) matutino (percent) vespertino, over (p9) name(p9, replace) title ("Motivo para trabajar") legend(off)
  grc1leg p6 p7 p8 p9, l1(Porcentaje) legendfrom(p6)
  </code></pre>
  
  <p>What I want is to have the four graphs in the same illustration but using the string labels I wrote down in each separate graph.</p>
  
  <p>I have also tried the label define option but it doesn't work when displaying the graphs.  The only solution I have found is creating new variables for each question using the string names. However, I have 154 questions and I think there should be an easier way.</p>
  
  <p>Cross posted <a href="https://www.statalist.org/forums/forum/general-stata-discussion/general/1486116-relabel-using-grc1leg" rel="nofollow noreferrer">on Statalist</a>. </p>