Skip to content

Instantly share code, notes, and snippets.

@bquistorff
Created November 20, 2014 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bquistorff/3df842f52a65c0f0399b to your computer and use it in GitHub Desktop.
Save bquistorff/3df842f52a65c0f0399b to your computer and use it in GitHub Desktop.
Translates a Stata gph file into other formats (and makes a no title version)
*! converts a *.gph file to another format
* Required globals: dir_base
program gph2fmt
args file fmt
graph use "${dir_base}/fig/gph/`file'", name(toexport)
local temp=regexm("`file'","(.+)\.gph")
local file_name_base=regexs(1)
graph export "${dir_base}/fig/`fmt'/`file_name_base'.`fmt'", replace
gr_edit .title.draw_view.setstyle, style(no)
graph export "${dir_base}/fig/`fmt'/notitle/`file_name_base'_notitle.`fmt'", replace
graph drop toexport
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment