Announcement

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

  • Labelling x axis values on bar graph

    Hello Im trying to label each x axis value with a certain word on my bar graph.

    This Is the current code im working with. For some reason when I run this code my graph does not have the proper labels I want, instead it just has numbers.

    Code:
    label define isic2_lbl 15 "Food" 16 "Tobacco" 17 "Textiles" 18 "Apparel" 19 "Footwear" ///
        20 "Wood" 21 "Paper" 22 "Recorded Media" 23    "Refined petroleum" 24 "Chemicals" ///
        25 "Rubber And Plastics" 26 "Nonmetallic" 27 "Basic Metals" 28 "Metal Products" ///
        29 "Machinery" 30 "Office Machinery" 31 "Electrical Machinery" 32 "Communication Equipment" ///
        33 "Watches And Clocks" 34 "Vehicles" 35 "Other Transport" 36 "Furniture"
    label values isic2 isic2_lbl
    
    * share of exports by industry ranked by 2000 employment
    graph bar share2000 share2017, ///
        over(rank, label(labsize(medsmall) angle(45)) gap(50)) ///
        graphregion(color(white)) ///
        ytitle("") ///
        legend(on label(1 "2000") label(2 "2017") ///
        rows(1)  span) outergap(10)     ///
        bar(1, color(dkorange)) bar(2, color(navy*.8))
    *graph display, ysize(3) xsize(5)
    Thanks.

  • #2
    You are labeling a variable named "isic2", which does not appear on your graph command.

    label values isic2 isic2_lbl

    Comment


    • #3
      Thanks!

      Comment

      Working...
      X