Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Value labels in twoway chart

    Hi, I have a variable measuring yearly income and label it:

    Code:
    label variable yearly_income "Yearly income" 
    label define yearly_income_l 1 "<$25k" 2 "$25-50k" 3 "50-75k" 4 ">$75k" 
    label values yearly_income yearly_income_l
    I try to plot this variable with the following command:

    Code:
    twoway (hist yearly_income if year==2010, width(0.8) fcolor(none) lcolor(black) discrete) (hist `yearly_income if year==2011, color(red%50) width(0.8) discrete),  xlabel(, valuelabel)
    However, the value labels do not appear in the chart. I was wondering if anyone can help me figure out what I am doing wrong?



  • #2
    I guess the xlabel() option is specified too late to take effect. I would try something more like

    Code:
     
     twoway hist yearly_income if year==2010, width(0.8) fcolor(none) lcolor(black) discrete /// || hist `yearly_income if year==2011, color(red%50) width(0.8) discrete  xlabel(, valuelabel)

    Comment


    • #3
      understood, thanks a lot!

      Comment

      Working...
      X