title: Problems with x-axis labels in event study graph
body: <p>I have the following data:</p>
  
  <pre><code>gen yr  coef        ci_l        ci_h
  F   -8  0.0059488   -0.004565   0.0164627
  F   -7  0.0040078   -0.0057631  0.0137786
  F   -6  0.0049703   -0.0085357  0.0184763
  F   -5  -0.0019084  -0.0211634  0.0173466
  F   -4  0.0013469   -0.0215072  0.0242009
  F   -3  0.036477    0.017118    0.0558361
  F   -2  0.1271414   0.089147    0.1651358
  F   -1  0.1431927   0.1021379   0.1842475
  F   0   0.1398031   0.1025783   0.177028
  F   1   0.1349187   0.0997429   0.1700946
  F   2   0.1355518   0.0997538   0.1713498
  F   3   0.1194403   0.0808667   0.1580139
  F   4   0.1060962   0.0668593   0.1453331
  F   5   0.1166223   0.0726827   0.1605619
  M   -8  0.0161407   0.0028669   0.0294144
  M   -7  0.0043735   -0.0065912  0.0153381
  M   -6  0.0114297   -0.0035314  0.0263908
  M   -5  0.0059428   -0.0149018  0.0267874
  M   -4  0.0081406   -0.0175235  0.0338046
  M   -3  0.0436267   0.0240535   0.0632
  M   -2  0.1387672   0.0848806   0.1926538
  M   -1  0.1582463   0.1001987   0.2162939
  M   0   0.1512713   0.0993361   0.2032066
  M   1   0.1477444   0.1023816   0.1931072
  M   2   0.1513944   0.107969    0.1948197
  M   3   0.1290913   0.0853945   0.1727881
  M   4   0.1182751   0.0722187   0.1643315
  M   5   0.1234578   0.0724435   0.1744721
  </code></pre>
  
  <p>What I want is to create a graph like this:</p>
  
  <p><a href="https://i.stack.imgur.com/n2Goy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n2Goy.png" alt="Event Study Graph"></a></p>
  
  <p>Where the 0 on the x-axis corresponds to the the year variable, and there is one line for each gender rather than for peaceful/divergence events.</p>
  
  <p>Currently, when I run the following Stata code:</p>
  
  <pre><code>twoway (sc coef year if gender == "M", mcolor(navy) lcolor(navy) connect(direct)) ///
  (rcap ci_low ci_high year if gender == "M", lcolor(navy)) (sc coef year if gender == "F", ///
  mcolor(maroon) lcolor(maroon) connect(direct)) (rcap ci_low ci_high year if gender == "F", ///
  lcolor(maroon)), legend(lab(1 "Male") lab(2 "Male CI") lab(3 "Female") lab(4 "Female CI")) ///
  xlab(,val)
  </code></pre>
  
  <p>I get something that looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Gle7r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gle7r.png" alt="Current Stata Output"></a></p>
  
  <p>I believe maybe the lines are right, but why is it appearing strange like that with the x-axis labels?</p>