Announcement

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

  • Resize graphs for putexcel but obtain good quality

    Dear all

    I am creating a data report with Excel and use putexcel to transfer the Stata graphs to excel. The height option has to be large for a good quality of the exported png.

    Code:
    sysuse auto.dta, clear
    histogram weight
    graph export pic.png, replace height(2000)
    putexcel set "pic.xlsx", modify open
    putexcel A1 = picture(pic.png)
    putexcel save
    However, using a large value makes the graph in Excel very large (for instance from coloumn A-Z) and I have to manually resize the exported graph in Excel. Is there a way to resize the exported png before put it into Excel or resize it from Stata afterwards? Unfortunately, I could not find an option for the "putexcel = picture"-command that is doing the resizing.

    Best wishes & thanks
    Martin
Working...
X