Announcement

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

  • How to sort the graph bar from the lowest to the greatest?

    Hi Dear,

    Please, How to sort the graph bar from the lowest to the largest by infant_mortality_2016?

    Click image for larger version

Name:	sort_d.PNG
Views:	1
Size:	46.4 KB
ID:	1450378

    Code:
    sencode country, g(countrys)
    twoway (bar infant_mortality_2016 countrys if com_exp == 1,  col(orange*0.5) barw(0.7))  ///
            (bar infant_mortality_2016 countrys if com_exp == 2,  col(magenta*0.4) barw(0.7))  ///
           (scatter infant_mortality_2000 countrys, mlcol(white) msize(medlarge) mcolor(midblue)), ///
           xlab(1/78,valuelabel ang(v) labsize(tiny) labcolor(midblue)) ylab(,angle(0))scheme(vg_rose)  ytitle("{bf: infant_mortality}", size(vsmall))  xtitle("") ///
            title("{bf: Evolution of}", size(medsmall)) ///
           legend(lab(1 "Oil exporting countries") lab(2 "Non-oil exporting countries") order(1 2 3) region(c(none))) ///
    Thanks,
    Best.

  • #2
    Did you try sorting your data by that variable before making the graph?

    Comment

    Working...
    X