Announcement

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

  • Export Stata multiple graph to excel side by side

    Hi Dear,

    I wanted your help to export the graphics of this Foreach loop into an excel file side by side. The code below exports all the graphics in a folder (debt_foreign). So, could you help me modify this one to answer my concern?

    Code:
    foreach crit of varlist $type {
    
    foreach criter of varlist $criteria  {
    graph bar (median) pub_debtf_tdebt pub_debtd_tdebt if `crit'==1 & year >=2000, ///
    over(`criter') ///
    bar(1, color(red*0.3)) bar(2, color(blue*0.7)) ///
    bargap(-20) ///
    legend(rowgap(1) label(1 "debt foreign (% total debt)") label(2 "debt domestic (% tot. debt)")) ///
    title("Evolution  of Public debt,foreign and domestic currency (% tot. debt) Since 2000", size(medsmall)) ///
    ytitle("Median of Public debt (% total debt)") ///
    subtitle("`crit'_exporters") ///
    nofill ///
    note("Source: IMF WEO April 2017, World Bank Staff Calculations", size(medsmall)) ///
    blabel(bar, position(inside) format(%9.1f) color(white))
    graph export "C:\Users\Perron\Downloads\restartingthework\Preparing slides\debt_foreign\gr_`crit'_`criter'_debt_med.png", as(png) width(1200) replace
    
    }
    }
    Kind regards,

  • #2
    Hi Firmin,

    A somewhat similar question was answered here. Perhaps it may help you.

    Comment

    Working...
    X