Announcement

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

  • adding vertical line to bar graph

    Hello, I am interested in adding a vertical line to a bar graph with labels. Here's a code I tried and an error showed up:

    Code:
    graph bar (mean) refipn [fweight = liab] if a == "LOANS ORIGINATED", over(year) ytitle(Percent) xaxis(1 2) title(Loans Originated Amt) note(Weighted by bank liability) xline(2009 2010 2012) xlabel(2009 "105%" 2010 "125%" 2012 "No Limit", axis(2)) xtitle("", axis(2))
    Error: xlabels(2009 105%" 2010 "125%" 2012 "No invalid name

    This works with twoway connected, but not with bar graph. Is there a way to add vertical line?
    Thanks in advance for your consideration.
    Amina
    Last edited by Amina Enkh; 05 Jun 2018, 13:22.

  • #2
    There is no x-axis in graph bar but a categorical axis. Therefore, I do not think you can do what you want in graph bar. You can however recreate the intended graph with twoway as you speculate.

    Comment


    • #3
      Thank you for your reply, I proceeded with "edit graph".

      Comment

      Working...
      X