Announcement

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

  • marking ticks in the bar graph

    Hi,

    Below is my code that I used to generate the following graph. I want to add ticks to the middle bar of my graph. How can I do it? Thanks!

    local y_title = "PIT as % of TTR"
    local title = "Personal Income Taxes"
    local sub_title = "(in percent of Total Tax Revenue(TTR), averages 1999-2000, 2001-2010, 2011-2016)"
    local footer = "Source: United Nations University UNU-WIDER"
    #delimit ;
    graph bar mean_PITtoTTR_90_00 mean_PITtoTTR_01_10 mean_PITtoTTR_11_16 ,
    over(Region_Name, label(angle(45) labsize(vsmall))))
    graphregion(color(white)) ytitle(`y_title', size(small))
    title(`title', size(small)) subtitle(`sub_title', size (vsmall))
    legend(label(1 "1999-2000") label(2 "2001-2010") label(3 "2011-2016")
    size(vsmall) symysize(vsmall) symxsize(vsmall) position(10) ring(0))
    text(-18 80 "`footer'", size(vsmall))bar(1, color(gold)) bar(2, color(sandb)) bar(3, color(sand));
    #delimit cr
    graph save "TTR Revenues by Decade and Region", replace
    graph export "TTR Revenues by Decade and Region.png", replace
    Attached Files

  • #2
    Hi,

    Can anyone please help me with the above query? Also if I want to show the percentages on the bar graphs, how can I do it? Thanks!

    Comment


    • #3
      I didn't answer this because I didn't understand it. Where do you want those ticks? You will be better off with some other display which avoids the giraffe graphics of text labels on a slant.

      The data are 24 values which you can show us using

      Code:
      dataex mean_PITtoTTR_??_?? RegionName
      FAQ Advice #12 explains if need be.

      Comment


      • #4
        oh sorry,

        I want them in the middle bar of every 'region'. 7 ticks in total.

        I changed the code to this:

        local y_title = "PIT as % of TTR"
        local title = "Personal Income Taxes"
        local sub_title = "(in percent of Total Tax Revenue(TTR), averages 1999-2000, 2001-2010, 2011-2016)"
        local footer = "Data Source: United Nations University UNU-WIDER"
        splitvallabels Region_Name, length(11)
        #delimit ;
        graph bar mean_PITtoTTR_90_00 mean_PITtoTTR_01_10 mean_PITtoTTR_11_16 ,
        over(Region_Name, relabel(`r(relabel)') label(labsize(vsmall)) gap(*1.4))
        graphregion(color(white)) ytitle(`y_title', size(small))
        title(`title', size(small)) subtitle(`sub_title', size (vsmall))
        legend(label(1 "1999-2000") label(2 "2001-2010") label(3 "2011-2016")
        size(vsmall) symysize(vsmall) symxsize(vsmall) position(10) ring(0))
        text(-7 0 "`footer'", size(tiny)) bar(1, color(gold)) bar(2, color(sandb)) bar(3, color(sand));
        #delimit cr

        Comment


        • #5
          Thanks!

          Comment


          • #6
            Sorry, but I still don't follow. If you're unwilling to give data, I won't try further code.

            Comment

            Working...
            X