添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
local graphs ""
foreach var of varlist _all {
line `var' year, name(`var') title(`var') graphregion(color(white)) xlabel(1980(2)2010,labsize(small)) ytitle("")
local graphs "`graphs' `var'"
gr combine `graphs', col(1) ysize(20) graphregion(color(white))
gr export check.pdf, replace
scatter mpg rep78, saving(gr`i', replace) aspectratio(1) gr combine gr1.gph gr2.gph gr3.gph, col(1) scheme(s1color) Res.:
With ysize(20) inches would mean that 200 graphs in one column, each individual graph would .1 of inch in height. However, since the minimum size is 1 inch would not be able to maintain the original aspect ratio of ysize(4) xsize(5.5).
If you fixed the height of the page at 20 inches then you could put 5 graphs with 4/5.5 aspect ratio. The maximum size is 100 inches, so you could put 25 graphs on one pdf page with the original aspect raito.
forv i = 1/25 { scatter mpg price , name(gr_`page'_`i', replace) local graphs "`graphs' gr_`page'_`i'" gr combine `graphs', col(1) ysize(100) name(gr_`page', replace) graph export "gr_`page'.pdf", as(pdf) name("gr_`page'") replace local graphs "" graph drop _all This will create 4 pages of 25 graphs where each page is 100 inches in length.
However, if you just want the graphs to be in a pdf document you can use -putpdf- Page size is limited to letter, legal, A3, A4, A5, B4, or B5.
Code:
putpdf clear
sysuse auto,clear
putpdf begin, pagesize(letter) margin(all,.25) halign(center)
putpdf paragraph
forv i = 1/25 {
    scatter mpg price, name(gr_`i', replace)
    graph export gr_`i'.png, as(png)  replace
    putpdf image gr_`i'.png, height(4) width(6)
putpdf save myreport.pdf , replace