Announcement

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

  • how to add the number of frequency to each bar in multi-variable bar graphic

    Hey colleagues,

    I have just plotted a multi-variable bar graph using the attached dataset. Basically, I attempt to display the three citation rates (Chinese citattion, English citation and sum citation) of four scholars, respectively named Yan, Zhao, Qin, and Tang.

    Below are my logfiles, which worked:

    graph bar sumcit chncit forcit, over(surnme) bargap(-25) legend(posi(1) rows(3) ring(0) lab(1 "Total citation") lab(2 "Chinese citation") lab(3 "English citation")) bar(2, bc(brown)) bar(3, bc(ltblue)) title("Citation Report of the Four Top IR scholars of China") ytitle("Number of citation") note("Source: ZhiWang, Google Scholar, and Amazon in Chinese")

    My question is how to add the number of citations for each of the three indicator on the top of the bars, which I highlighted as yellow in the attached graphic. I tried a number of times. "freq" or "(freq)" did not work. Neither did "(count)". I would like to seek help from you .

    Many thanks!

    Sincerely
    Raymong Luckas
    Attached Files

  • #2
    You just need to use the blabel option:

    Code:
    graph bar sumcit chncit forcit, over(surnme) bargap(-25) ///
        legend(posi(1) rows(3) ring(0) lab(1 "Total citation") lab(2 "Chinese citation") lab(3 "English citation")) ///
        bar(2, bc(brown)) bar(3, bc(ltblue)) title("Citation Report of the Four Top IR scholars of China") ytitle("Number of citation") ///
        note("Source: ZhiWang, Google Scholar, and Amazon in Chinese") ///
        blabel(bar, format(%5.0fc))

    Comment


    • #3
      Hey Hemanshu, thank you a lot for quick response! It does work!

      Comment

      Working...
      X