Announcement

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

  • x label errors while plotting bar chart

    Hi I am plotting a bar chart for summary of a variable over different variables. I keep on getting following error while plotting the bar and cannot seem to figure out why the error is happening:

    Error message:
    xlabels(2 Overall" 4 "Rural" 5 "Urban" 7 "ST" 8 "SC" 9 "OBC" 10 "Other" 12 "Q1" 13 "Q2" 14 "Q4" 1
    > 5 "Q5" 16 "Q6" 18 "Male" 19 "Female" 21 "Illiterate" 22 "Inc invalid name

    codes:
    graph bar hip, over(id,label(labsize(small) angle(90))) ///
    xlabel(2 "Overall" 4 "Rural" 5 "Urban" 7 "ST" 8 "SC" 9 ///
    "OBC" 10 "Other" 12 "Q1" 13 "Q2" 14 "Q4" 15 "Q5" 16 "Q6" 18 "Male" 19 "Female" ///
    21 "Illiterate" 22 "Inc Primary" 23 "Primary" 24 "Sec/higher Secondary" 25 "Higher" ,noticks)

  • #2
    graph bar has no xlabel() option: indeed it is declared not even to have a x axis. You're using syntax that applies to graph twoway.

    Consider this example to see syntax

    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . graph bar mpg, over(rep78)
    
    . graph bar mpg, over(rep78, relabel(1 "Appalling" 2 "Abysmal" 3 "Acceptable" 4 "Admira
    > ble" 5 "Amazing"))
    Note that 1 2 3 and so on apply to the 1st 2nd 3rd bar and so on and do not correspond to values of the over() argument.

    Comment

    Working...
    X