Announcement

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

  • Labelling "xline"

    Hello all,

    I have a CDF with a few "xlines". However I am unsure how to label these xlines. For example for the xline 49.90, I want a SA label saying "mean South African hourly wage", 26.34 "median South African hourly wage" etc.

    Code:
    twoway (line  cumul1 hourlywage if status==1 &hourlywage<200, sort), ytitle(Cumulative Distribution) xtitle(Hourly Wages) xline(11.60 12.33 12.80 16.82 26.34 49.90) title(South African Wage Distribution)
    Thanks!

  • #2
    Just put an axis label at the same position using xlabel() or xmlabel()

    Comment


    • #3
      Originally posted by Nick Cox View Post
      Just put an axis label at the same position using xlabel() or xmlabel()
      Thanks. I seem to get an invalid label specifier error when I attempt it though:

      Code:
      twoway (line  cumul1 hourlywage if status==1 &hourlywage<200, sort), ytitle(Cumulative Distribution) xtitle(Hourly Wages) xline(11.60 12.33 12.80 16.82 26.34 49.90) xlabel (11.60 "Median Covered Workers" 12.33 "Median Sectoral Determination" 12.80 "Mean Sectoral Determination" 16.82 "Mean Covered Workers" 26.34 "Median South African Wage" 49.90 "Mean South African Wage") title(South African Wage Distribution)

      Comment


      • #4
        Please show us the "invalid label specifier error".

        You have an illegal space between -xlabel- and its parenthesis. To me this works:
        Code:
        .sysuse auto , clear
        . scatter weight mpg , xlabel(25 "text")
        but a space gives an error:
        Code:
        . scatter weight mpg , xlabel (25 "text")
        parentheses do not balance
        r(198);

        Comment

        Working...
        X